Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Could you advise on the best method to extract information from a string? I'm looking to get the information of the filename, but the string comes through with the folder location aswell as the filename (and filetype). Ideally, the only piece of information I want is the filename.
The below shows some example data, as you can see the number of folders may change as does the length of the string and the fileattachment.
C:\Temp\Folder1\Outbound\filename1.xml
C:\Temp\Folder2\Outbound\filename_test1.xml
C:\Temp\Folder1\Inbound\filename_test2.txt
C:\Temp\Folder3\Outbound\filename2.xlsx
C:\Temp\Folder1\Outbound_Test1\data1.doc
C:\Temp\Folder2\Outbound_Test2\filename11.docx
C:\Temp\Folder2\Dev\Outbound\filename12.xml
C:\Temp\Folder4\Live\Inbound\filename31.xml
C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml
So for "C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml" I would like the result of "filename41".
Any help you could provide would be great!
Kind Regards,
Dayna
Hi Dayna,
Another option:
Mid( 'C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml' , Index('C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml', '\', -1) +1) , '.', 1)
Hope that helps.
Miguel
Hi Dayna,
Another option:
Mid( 'C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml' , Index('C:\Temp\Folder4\Dev\2601\Outbound\Customer1\filename41.xml', '\', -1) +1) , '.', 1)
Hope that helps.
Miguel