2dkot Posted November 25, 2008 Share Posted November 25, 2008 I want to find some peace of text in Blah.txt. and then copy it to message window. For example: ______________________________________ Text in Blah.txt: 12.3 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah 12.4 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah 12.5 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah _______________________________________ Message window must show the following text: 12.4 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah Is there any chance to find some peace of text? Link to comment Share on other sites More sharing options...
November Posted November 25, 2008 Share Posted November 25, 2008 I want to find some peace of text in Blah.txt. and then copy it to message window. For example:______________________________________Text in Blah.txt:12.3 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah12.4 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah 12.5 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah _______________________________________Message window must show the following text: 12.4 BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlah Is there any chance to find some peace of text?Hi there,Take a look at the help file for this commands:FileReadLine_FileReadToArray_StringBetweenStringTrimThis commmands are a start point for you request.Cheers. Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
Uten Posted November 25, 2008 Share Posted November 25, 2008 Or look at StringRegExp() Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
rasim Posted November 25, 2008 Share Posted November 25, 2008 2dkotTry this:$sFile = @ScriptDir & "\Blah.txt" $sRead = FileRead($sFile) $aString = StringRegExp($sRead, "12.4[\w-\W\r\n]*\r\n\r\n", 1) If @error Then Exit MsgBox(0, "Result", $aString[0]) Link to comment Share on other sites More sharing options...
2dkot Posted November 26, 2008 Author Share Posted November 26, 2008 2dkot Try this: $sFile = @ScriptDir & "\Blah.txt" $sRead = FileRead($sFile) $aString = StringRegExp($sRead, "12.4[\w-\W\r\n]*\r\n\r\n", 1) If @error Then Exit MsgBox(0, "Result", $aString[0]) Thanks for help everyone. It works if I use example text but not if I try another one ^(((. Well, the problem is that script finds only the beginning of peace of text. 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