Sign in to follow this  
Followers 0
2dkot

Text searching with AutoIT

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



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?

Hi there,

Take a look at the help file for this commands:

FileReadLine

_FileReadToArray

_StringBetween

StringTrim

This 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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0