Noob Q - Extracting file name

Recommended Posts

Say I have a file c:\text.txt and I just want text.xt without the path, how do i do this?

and the same with http://www.domain.com/abc.txt I just want to extract abc.text

Share on other sites

StringSplit() with / and/or \ as a deliminator. Then just get the last value in the returned array.

Share on other sites

Say I have a file c:\text.txt and I just want text.xt without the path, how do i do this?

and the same with http://www.domain.com/abc.txt I just want to extract abc.text

1.

$string = "c:\text.txt"$string = StringRegExpReplace($string, "^.*\\", "") MsgBox(0, "Result",$string)

2.

InetGet()

Create an account

Register a new account