Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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);
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);
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);
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
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);
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);
TMP:
LOAD
* // All fields
FROM
[\\vmbis\HotFiles\SALES_INTERNATIONAL_*.csv] //all csv with SALES_INTERNATIONAL_
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);