markusss Posted October 12, 2005 Posted October 12, 2005 Hey! First of all, if there is a post about this please gimme the link and dont say "Use search you n00b!". I used the search, it returned like 36 pages, went through first 2 and did't find anything... thx ---------------------------------------------------------------------------------------------------------------- Ok heres my question: Is there a way to get only the filename in a path ? So, lets say my path is: "C:\somefolder\somefile.txt" And i want autoit to return: "somefile.txt" I looked at the several string**** functions, but didn't find anything that worked :"> . I thought StringInStr would work so i get the position where the filename starts and then use one of the trim commands. But for the StringInStr i need some kind of a placeholder, one for "*" (undefined amount of characters) and one for the end of the string. Any solutions for this?? Would greatly appreciate it! tdlrali (Felix)
Developers Jos Posted October 12, 2005 Developers Posted October 12, 2005 $FilePath = "C:\somefolder\somefile.txt" $File = StringTrimLeft($FilePath,StringInStr($FilePath,"\",0,-1)) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
markusss Posted October 12, 2005 Author Posted October 12, 2005 Thanx Was too easy! ^^ +10 points honor for JdeB tdlrali
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now