Jump to content

Help please to parse information


6105
 Share

Recommended Posts

Dear Autoit community,

i have a problem with parsing my file,

can anybody give me some tips who i'll can do it?

i read help file, but can not find the solution, thanks.

My file:

RandomWords1

11 Fixed: RandomWords

Fixed1: RandomNr

Fixed2: Random%

Fixed4

Random-Nr4

$Random-N7

Fixed8

i need tips how i'll can to navigate and take any needed random number or word in the file.

I'll try to surf more this forum, if i'll find solution i'll update topic.

Thank you.

Edited by 6105

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

would you paste in the actual data (remove sensitive info), and maybe surround the data you are looking for with []

just so we can see if a regexp would be easily coded

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

#jdelaney, sorry i don't understand your question but if you ask about code, i try now this:

$sText = FileRead("C:UsersJohnDocumentstest.txt")
$aString = _StringBetween($sText, "Fixed", "Fixed8")
ConsoleWrite("$aString = " & $aString & @CRLF)
$OutputFriends = StringStripWS($aString[0], 4)
_ArrayAdd($avArray, $OutputFriends)
_ArrayDisplay($aString)
ConsoleWrite("$OutputFriends = " & $OutputFriends & @CRLF)

It put all the needed words in console, separated by new line, i think maybe to find posibility to read by line, if i'll can't parse.

but, StringRegExp code, will need to look like it:

$sText = FileRead("C:UsersJohnDocumentstest.txt")
$aString = StringRegExp($sText,'11Fixed(.*[d+]).*Fixed1',1)
$OutputFriends = StringStripWS($aString[0], 8)
ConsoleWrite("$OutputFriends = " & $OutputFriends & @CRLF)

Problem, is in search string "'11Fixed(.*[d+]).*Fixed1'" i'm not sure how to navigate in it, i have 2 lines:

1. Fixed word

2. Needed number

How i can find fixed word and take needed number from next line?

Thank you so much for any tips.

Edited by 6105

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
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
 Share

×
×
  • Create New...