EndFunc Posted April 6, 2007 Share Posted April 6, 2007 (edited) I have been working on this forever. How can you use StringSplit to get the filename only and not the whole path. I tried using something like $Path = StringSplit("C:\test\testfolder\test.txt", "\", 1) Well the thing is how can you determine what the last value of the array is without knowing the number of the array?? Anybody know? Edited April 6, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
BrettF Posted April 6, 2007 Share Posted April 6, 2007 By good ol' SmokeN (This Thread):$url = 'http://www.somepath.com/and/so/on/etc/filename.ext' $aurl = StringTrimLeft($url, StringInStr($url, '/', 0, -1)) MsgBox(0, '', $aurl) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
EndFunc Posted April 6, 2007 Author Share Posted April 6, 2007 By good ol' SmokeN (This Thread): $url = 'http://www.somepath.com/and/so/on/etc/filename.ext' $aurl = StringTrimLeft($url, StringInStr($url, '/', 0, -1)) MsgBox(0, '', $aurl) oÝ÷ Ûú®¢×©ä°"[¬zØZ¶Þjëh×6$SplitFile = StringSplit("C:\test\folder1\folder2\myfile.text", "\") _ArrayReverse($SplitFile, 1) MsgBox(0,0, $SplitFile[1])! I was playing around and actually got this to work. Pretty crude but it worked. EndFuncAutoIt is the shiznit. I love it. Link to comment Share on other sites More sharing options...
xcal Posted April 6, 2007 Share Posted April 6, 2007 If you're going to do it like that, might aswell just do it like so... $SplitFile = StringSplit("C:\test\folder1\folder2\myfile.text", "\") MsgBox(0,0, $SplitFile[$SplitFile[0]]) How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
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