Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
This is an example for a path that I have:
C:\decisioning\log\dcs\1\1\dcs_meta_data_20131126113434.csv
I need to compare the folder number highlighted in RED to a list.
how can I isolate the folder number?
I had a code written with FileName function but I know it doesn't work in regular script but only in load script.
regards,
Boris
try
subfield('C:\decisioning\log\dcs\1\1\dcs_meta_data_20131126113434.csv','\',-3) will return the second last directory
I am not sure if i understood your question, but, are you trying to achieve this in the expression or you are trying in the load script.
If in load script, you can use the subfield syntax to get the string.
Regards,
Aadil
Load *, filedir( ) as X from
C:\UserFiles\abc.txt
Will return 'C:\UserFiles' in field X in each
record read.
So you could use:
load subfield(filedir(),'\',5) as FolderNumber
Hope that helps!
regards.janne
try
subfield('C:\decisioning\log\dcs\1\1\dcs_meta_data_20131126113434.csv','\',-3) will return the second last directory