Lukas Posted January 17, 2011 Share Posted January 17, 2011 Hello, I want a solution to identifying only the words between certain characters. Ex: C:\test1\test2\file.txt Identify only "test1", "test2" are among "\". Link to comment Share on other sites More sharing options...
taietel Posted January 17, 2011 Share Posted January 17, 2011 (edited) One way is to use RegExp. Other way, use StringSplit, $sTest = StringSplit("c:\test1\test2\file.txt","\",2) MsgBox(64,"","You searched for "&$sTest[2]&" and " &$sTest[3]) Edited January 17, 2011 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
Lukas Posted January 17, 2011 Author Share Posted January 17, 2011 (edited) Hello, I want a solution to identifying only the words between certain characters.Ex:C:\test1\test2\file.txtIdentify only "test1", "test2" are among "\".Thank you, perfect!Another question please, in the case below:test1/test2\test3/test4Identify only "test2"and "test3", being among different characters "/" and "\"as would be please? Edited January 17, 2011 by LukaS Link to comment Share on other sites More sharing options...
taietel Posted January 17, 2011 Share Posted January 17, 2011 $sTest = StringRegExpReplace("test1/test2\test3/test4", "\/", "\\") $aTest = StringSplit($sTest,"\",2) For $i=0 To UBound($aTest)-1 ConsoleWrite($aTest[$i]&@CRLF);write to Scite console all the values Next Ask if it's unclear. Sorry for the delay, but my internet connection stinks. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
Lukas Posted January 17, 2011 Author Share Posted January 17, 2011 Thank you, perfect!Another question please, in the case below:test1/test2\test3/test4Identify only "test2"and "test3", being among different characters "/" and "\"as would be please?Excellent, thanks again! Link to comment Share on other sites More sharing options...
taietel Posted January 17, 2011 Share Posted January 17, 2011 You are welcome!One suggestion: when you reply, try to use Add Reply button from the button of the page. This way, the previous post is not copied (unless your intention is to quote, of course).M.I. Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
Lukas Posted January 17, 2011 Author Share Posted January 17, 2011 Thank you and grateful for the suggestion! 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