Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

When importing multiple csv in a folder, the header appears in the values

Dear all,

I have a number of csv files in a folder, named File1, File2 etcetc.

I am loading from them using explicit labels, as I need to rename some fields

problem is, if I use the following script

FROM

[Folder\File*.csv]

(txt, codepage is 1252, explicit labels, delimiter is ',', msq);

In the resulting fields the header is one value of the field.

E.g, if it was

LOAD

@1 as Item

In the resulting *.qvw, the Item fields is also going to contain an 'Item' value..

any idea how to overcome this??

Im clearly stating I have this problem when using explicit labels, because if I use embedded labels, the problem does not show up..

Thank you!

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

I don't quite understand what you need. If you want to skip the header you can use 'no labels' in combination with 'header is 1'. That way you will only load the data.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
MVP & Luminary
MVP & Luminary

I think you want to use 'embedded labels' instead of 'explicit labels'

from the help file:

The field names can be found in different places of the file. If the first record contains the field names, embedded labels should be used. If there are no field names to be found, no labels should be used. In dif files, a separate header section with explicit field names is sometimes used. In such a case, explicit labels should be used. If nothing is specified, embedded labels is assumed, also for dif files.


talk is cheap, supply exceeds demand
Not applicable

I actually updated my post meanwhile you replied.

With embedded labels there is not such a problem, but since this csv files are updated weekly, with rolling data, the headers are changing too, according to the day to which they refer to.

Therefore I need to take field position when I do the load...

Partner
Partner

Hi when ur importing the .csv files from edit script using table files , once u select the files u have labels on extreme right , if u use embedded labels then u will get rid of @1..

hope this helps

Not applicable

Please look above post of mine

I need to use @1, @2 etcetc, beacuse headers labels are changing weekly!

MVP & Luminary
MVP & Luminary

I don't quite understand what you need. If you want to skip the header you can use 'no labels' in combination with 'header is 1'. That way you will only load the data.


talk is cheap, supply exceeds demand

View solution in original post

Not applicable

Actually, yes!

you are right!

the solution was so obvious (and my brain is fried up, seems like), that I did not think about it!

Since I am creating my own labels and using the field positions, I can skip all the first rows of all files!

nice, it is always like this, the most ingenious solutions, are the simplest!