Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Script Help

I am not quite sure what this code is doing?

The situation is that I have a folder that contains many csv files.  Basically one for each day. 

Here is the basic script that exists.

EmployeeMaster:

LOAD *

FileName()

FROM

[lib://QVS-1 DEV/External Data\EmployeeMaster\EmployeeMaster*.csv]

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

Store EmployeeMaster into (QVD file)

Does this code loop through all of the csv files in this folder and concatenate the data into the QVD?

If that is the case is this the optimal way to do this?

What is the filename() function doing in this case?

1 Solution

Accepted Solutions
sunny_talwar

That is exactly what it is doing. Grabbing each file and storing all its data along with the file name (FileName() function returns the name of the file. For example if you EmployeeMaster02152017.csv, then this is the value which will be stored in FileName() field for all rows from this csv file.

View solution in original post

2 Replies
sunny_talwar

That is exactly what it is doing. Grabbing each file and storing all its data along with the file name (FileName() function returns the name of the file. For example if you EmployeeMaster02152017.csv, then this is the value which will be stored in FileName() field for all rows from this csv file.

vlad_komarov
Partner - Specialist III
Partner - Specialist III

Looks like you are trying to extract the full names of EmployeeMaster*.csv files from External Data\EmployeeMaster\ folder....

Another option is to use FileList:

For each vFile in FileList('C:\path\*.txt')

          Load ... From [$(vFile)] ;

Next vFile

Which is identical to

Load ... From ;