Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Load several CSV Files where name begins with..

Hi Guys,

there's a way to load all csv files that have as name SALES_INTERNATIONAL_ instead of creating new script for each year?

Thanks

here my script:

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_2017.csv]

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

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_2016.csv]

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

6 Replies
prieper
Master II
Master II

use the "*" in the filename:

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv]

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

Anil_Babu_Samineni

May be use * like below

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv]

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
karthikoffi27se
Creator III
Creator III

Hi Antonio,

Please use the below script

LOAD

     RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL*.csv]

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

Many Thanks

Karthik

shraddha_g
Partner - Master III
Partner - Master III

Try

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv]

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

Kushal_Chawda

if all your CSV files have same number of columns with same name then you can try below

LOAD RECORD_NO,

     COMPANY,

     CUSTOMER_NO,

     YEAR,

     MONTH,

     ITEM_NO,

     QUANTITY,

     EXTENDED_PRICE_AMT_LCL

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv]

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

eduardo_dimperio
Specialist II
Specialist II

TMP:

LOAD

*                                                                                                     // All fields

FROM

[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv]                     //all csv with SALES_INTERNATIONAL_

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