Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am loading multiple files from the same folder using *. Is there any way of taking the name of each file and adding as a field within the table?
Thanks in advance,
James
Sure,
You just need to change the order and some parameters, like this:
Let us say that your cross table is like this:
CrossTable(Name, Value,3)
Load *
From ...
You change it to:
CrossTable(Name, Value,4)
Load filename() as fileName, *
From ...
Hope this helps,
Erich
Hi,
You can include some functions in the load, like this:
Load *, filename() as Filename
From *.txt (txt);
or you can use Filebasename()
Hope this helps,
Erich
what you are looking for might be the file Functions eg.:
LOAD
*,
filename() as LoadFile
FROM *.QVD (qvd) ;
ther more available like filedir() etc. which you can find in the help.
Thanks Erich, I have tried this on a standard load and it works fine. Is there any way of doing this on a Crosstable load?
Sure,
You just need to change the order and some parameters, like this:
Let us say that your cross table is like this:
CrossTable(Name, Value,3)
Load *
From ...
You change it to:
CrossTable(Name, Value,4)
Load filename() as fileName, *
From ...
Hope this helps,
Erich
Yes that works perfectly, many thanks for your help.
James
Hi
Similar to it can resident load possible with the above statement as i had mentioned below, i tried doing it ,gets reloaded without any error but couldn't get any values after the reload... pls help
TABLE1:
CrossTable(DATE1, Data,2)
LOAD
LEFT(FileName (),6) AS FileDate,
Name,
[1],
[2],
[3],
[4],
[5],
[6],
[7],
[8],
[9],
[10],
[11],
[12],
[13],
[14],
[15],
[16],
[17],
[18],
[19],
[20],
[21],
[22],
[23],
[24],
[25],
[26],
[27],
[28],
[29],
[30],
[31]
FROM
[032014.xls]
(biff, embedded labels, table is DATA$);
TABLE2:
LOAD *
Resident TABLE1;
DROP Tables TABLE1;