Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
thanks a lot in advance.
I have a problem which I really do not understand an it has to be extremely simple...
I have this code...
which basically goes to a path, take every file and in a variable load the name of the register.
The problem is that I do not know how to store every name (the values I am storing in the variable into a table with just one field, the name of file).
Where is the fail?
let vVariable = '';
FOR EACH vFile IN FileList ('C:\Documents and Settings\cgi\Desktop\QV 10\CTO_VOD\CTO Vodafone\images\CTO\Projects' & '\*')
// You get the name of the file excluding the path
LET vFileName = Right('$(vFile)', Len('$(vFile)') - Index('$(vFile)', '', SubStringCount('$(vFile)', '')));
Names_Table:
LOAD
vFileName as Name;
next vFile;
Thanks a lot!
Hello,
it's quite simple:
Names_Table:
LOAD
'$(vFileName)' as Name
AUTOGENERATE 1;
Did not work,
but this one did!
Thanks a lot anyway!
Table_Projects_Jpgs:
load * inline [imageName
'$(vNameFile)'];
very strange.
I always use such approach
Thanks a lot Sparur.
Now I am having other issue.
I have names like test1.jpg, test2.bmp, test3.jpeg.
Anyway I can get rid of the point and that comes after the name?
You need to use function INDEX() to find the position of the dot in the string and then use the result inside function LEFT() to cut out the part that you need. Something like this:
LEFT( NAME , INDEX(NAME, '.', -1) - 1)
The function INDEX(NAME, '.', -1) returns the last position of a dot in the NAME (assuming that you might have more than one dot in a file name)
cheers,