Every day I received reports from partners with standard name "blabla_<PartnerName>_blabla_<date>.csv". Which have same columns. How can I add Two columns -- Partner and Date, which will be filled by values from filenames?
filename() function will return blablabla_partner_blabla_date.csv
subfield function will get string delimited by '-'
subfield(filename(), '-', 2) as partner,
subfield(filename(), '-', 4) as date
It works. Thanks Cristian
subfield(filebasename(),'_',-1) as Date,
subfield(filebasename(),'_',-3) as Partner
You can use FileName() function and sub field function to capture the Patner name and Date.
Load *,FileName() as FN ..............
Please take a look at the example.
Retrieving data ...