Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
as you can read in the title, how can I to the text between function from the right side?
Example:
c:\\Folder\Sub\Sub2\File1.txt
c:\\Folder\Sub\Sub3\Sub7\File2.txt
c:\\Folder\Sub\Sub2\File3.txt
I need to get a column with values like this:
Table:
File1,
File2,
File3.
Is there a way to do this?
Thanks in advance
subfield(subfield('c:\\Folder\Sub\Sub2\File1.txt', '\', -1),'.',1)
subfield(subfield('c:\\Folder\Sub\Sub2\File1.txt', '\', -1),'.',1)
Try this may be:
Replace(SubField(FieldName, '\', -1), '.txt', '')
Update:
Script:
Table:
LOAD *,
Replace(SubField(FieldName, '\', -1), '.txt', '') as NewFieldName;
LOAD * Inline [
FieldName
c:\\Folder\Sub\Sub2\File1.txt
c:\\Folder\Sub\Sub3\Sub7\File2.txt
c:\\Folder\Sub\Sub2\File3.txt
];
Output:
Hi
The script is like this.
T1:
LOAD * Inline [
data
c:\\Folder\Sub\Sub2\File1.txt
c:\\Folder\Sub\Sub3\Sub7\File2.txt
c:\\Folder\Sub\Sub2\File3.txt
];
T2:
LOAD *,
SubField(SubField(data,'\',-1),'.',1) AS FILE
Resident T1;
DROP Table T1;
see the attached qvw