Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I have two string manipulation questions:
Lower(Right(Name, Len(Name)-Index(Name, '.', 1))) AS Extension |
"filename 1. of 2.txt"
So basically how do I go from the right to get the first "."?
Thank you.
Hi
1. Date(Date#(Left(FileBaseName(), 8), 'YYYYMMDD'))
2a. SubField(Name, '.', -1) As Extension
2b. Left(Name, Len(Name) - Len(SubField(Name, '.', -1)) -1) As FileName
HTH
Jonathan
For the second question use filename() and fileextension() they shoul have to work ...
for the first question an option (apart date formatting) could be:
look at filebasename and fileextension
Fileinformation:
LOAD
date(left(filebasename(),6),'DD.MM.YYYY') as Date,
FileExtension() as Extension
FROM
*.qvd
(qvd);
Regards
Hi
1. Date(Date#(Left(FileBaseName(), 8), 'YYYYMMDD'))
2a. SubField(Name, '.', -1) As Extension
2b. Left(Name, Len(Name) - Len(SubField(Name, '.', -1)) -1) As FileName
HTH
Jonathan
Thank you all for showing different ways.