Extract data to the right of character (1 Viewer)

Daigriff

New member
Local time
Today, 10:21
Joined
Jun 2, 2012
Messages
4
Hi,
I need to extract the file extension from a full file name. Unfortunaltly some of the file names have multiple . in the file name e.g.

C:\Filename.test.dvd.doc

So in the example above I need to extract "doc". Also the length of the file extension varies so I can not just look for the last three characters.

Ideally I need to find the last "." in the string and extract all data to the right of the last "."

Any ideas?

Thanks in advance,

Daigriff
 

Brianwarnock

Retired
Local time
Today, 10:21
Joined
Jun 2, 2003
Messages
12,701
InstrRev and Mid are the functions you need.
Note that Mid without a length parameter extracts all of the data in the string from the start point.

Brian
 

Daigriff

New member
Local time
Today, 10:21
Joined
Jun 2, 2012
Messages
4
Hi,
thanks for the advice

Mid([File name],InStrRev([File name],".")+1) works a treat

daigriff:)
 

Users who are viewing this thread

Top Bottom