jerem488 Posted May 30, 2009 Share Posted May 30, 2009 (edited) Hello, I have a little problem. I have a string "H:\down\others\filename.txt" And I want extract only H:\down\others\ I know it's with StringRegExp function but I'm bad with this function Don't say me to look on the forum. I have already search, there are many examples. I have test many solutions, but I haven't the good result. Thank you Edited May 30, 2009 by jerem488 Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
Mat Posted May 30, 2009 Share Posted May 30, 2009 look here:http://www.autoitscript.com/forum/index.php?showtopic=95580; Author: Malkey $sPath = StringRegExpReplace($sFile, "(^.*\\)(.*)", "\1")I think is what you wantMDiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 30, 2009 Share Posted May 30, 2009 There ist also _PathSplit Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jerem488 Posted May 30, 2009 Author Share Posted May 30, 2009 Yes, it's this ! But same with the help file of Autoit and exmaples, I am too hard to understand... Why /1 ?? ! And me, I did this with StringRegExp function ! ! Maybe i would understand this functions a day.... Thanks a lot Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
nguyenbason Posted May 30, 2009 Share Posted May 30, 2009 My long way to do that. Maybe it's useful $File = "H:\down\others\filename.txt" $array = StringSplit($File,"\") _ArrayDelete($array,0) _ArrayDelete($array,UBound($array)-1) MsgBox(0,"",_ArrayToString($array,"\") & "\") UnderWorldVN- Just play the way you like it 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