Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

nsnybs21qv
New Contributor II

Load and concatenate all files in a folder

Hi

I'm trying to load and concatenate all .csv files in a folder. Below is  my script but it didn't load any data. Any idea why?

-------------------------------------------------------

Let path = 'H:\SPC\QV File folder\*.csv';

for each file in FileList(Path)

Data:

Load

*

from $(file)

(txt, utf8, no labels, delimiter is ' ', msq, header is 6 lines);

Next file

1 Solution

Accepted Solutions
MVP
MVP

Re: Load and concatenate all files in a folder

Let Path = 'H:\SPC\QV File folder\*.csv';

for each file in FileList('$(Path)')

     trace $(file);

     Data:

     Load

          *

     from $(file)

     (txt, utf8, no labels, delimiter is ' ', msq, header is 6 lines);

Next file

5 Replies
Employee
Employee

Re: Load and concatenate all files in a folder

Would you mind posting your log file?

Please enable it at Document Properties / General / tick Generate log file

MVP
MVP

Re: Load and concatenate all files in a folder

Let Path = 'H:\SPC\QV File folder\*.csv';

for each file in FileList('$(Path)')

     trace $(file);

     Data:

     Load

          *

     from $(file)

     (txt, utf8, no labels, delimiter is ' ', msq, header is 6 lines);

Next file

nsnybs21qv
New Contributor II

Re: Load and concatenate all files in a folder

still no data loaded...

nsnybs21qv
New Contributor II

Re: Load and concatenate all files in a folder

This is in the log file. Any hint?

9/3/2015 2:22:04 PM:      UserLogfileCharset            1200

9/3/2015 2:22:04 PM:      OdbcLoginTimeout              -1

9/3/2015 2:22:04 PM:      OdbcConnectionTimeout         -1

9/3/2015 2:22:04 PM:      ScriptWantsDbWrite            false

9/3/2015 2:22:04 PM:      ScriptWantsExe                false

9/3/2015 2:22:04 PM:      LogFile CodePage Used:        1200

9/3/2015 2:22:04 PM:       Reload Executed By NAEAST\e779672

9/3/2015 2:22:04 PM:       Process Executing: QlikView Desktop

9/3/2015 2:22:04 PM:       Process ID: 8224

9/3/2015 2:22:04 PM: 0002  SET ThousandSep=','

9/3/2015 2:22:04 PM: 0003  SET DecimalSep='.'

9/3/2015 2:22:04 PM: 0004  SET MoneyThousandSep=','

9/3/2015 2:22:04 PM: 0005  SET MoneyDecimalSep='.'

9/3/2015 2:22:04 PM: 0006  SET MoneyFormat='$#,##0.00;($#,##0.00)'

9/3/2015 2:22:04 PM: 0007  SET TimeFormat='h:mm:ss TT'

9/3/2015 2:22:04 PM: 0008  SET DateFormat='M/D/YYYY'

9/3/2015 2:22:04 PM: 0009  SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT'

9/3/2015 2:22:04 PM: 0010  SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec'

9/3/2015 2:22:04 PM: 0011  SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun'

9/3/2015 2:22:04 PM: 0038  Let Path = 'H:\SPC\QV File folder\*.csv'

9/3/2015 2:22:04 PM: 0042  for each file in FileList('H:\SPC\QV File folder\*.csv')

9/3/2015 2:22:04 PM: 0065  exit script

9/3/2015 2:22:04 PM:      Execution finished.

MVP
MVP

Re: Load and concatenate all files in a folder

in my Qlik it works

Let Path = 'C:\Users\mgrossi\Downloads\*.csv';

for each file in FileList('$(Path)')

trace $(file);

Data:

Load

*

from $(file)

(txt, utf8, no labels, delimiter is ' ', msq, header is 6 lines);

Next file

this is the log

C:\Users\mgrossi\Downloads\Table_a1.csv

Data << Table_a1 49 lines fetched

C:\Users\mgrossi\Downloads\Table_a2.csv

Data << Table_a2 98 lines fetched

Do you have csv files in the folder?

Community Browser