ConsultingJoe Posted September 8, 2006 Share Posted September 8, 2006 ok, what i am trying to do, is find the location in a file where there is 17 unknown numbers, a space, and 17 other unknown numbers. I thought that StringRegExp could be used for it but I dont know how to use it. Can someone PLEASE HELP THANKS [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2006 Share Posted September 8, 2006 maybe... #include <file.au3> Dim $aRecords If Not _FileReadToArray("error.log",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] $split = StringSplit($aRecords[$x], " ") for $t = 1 to $split[0] If StringLen($split[$t]) = 17 Then If StringLen($split[$t-1]) = 17 Then Msgbox(0,'Record:' & $x, $aRecords[$x] & @CRLF & $split[$t] & @CRLF & $split[$t-1]) ExitLoop EndIf EndIf Next Next 8) Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 $aRecords[0] doesnt hold the lines??? [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 $aRecords[0] doesnt hold the lines???the file is a database file so there is weired charactors, that can effect it, i think? [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 here is the file: http://cyberzerocool.com/server.dbs [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 It wouldn't. The file is probably way too big. When you say "number", you mean digit, correct? As in the numbers 1-9 and 0? Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2006 Share Posted September 8, 2006 the code i gave above just worked for me... it found that same series of numbers three timesdid you change this????If Not _FileReadToArray("error.log",$aRecords) Then Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 Sorry Valuater, I didn't see the link to the file. I just figured the file was too big to fit into an array. I assumed he was trying to work with a game file. Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 the code i gave above just worked for me... it found that same series of numbers three timesdid you change this????If Not _FileReadToArray("error.log",$aRecords) ThenOk, yes it does work thanks, but why does it have to be in the same directory? [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 Ok, yes it does work thanks, but why does it have to be in the same directory?It doesn't *have* to be. You just have to add code to locate the file otherwise. Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2006 Share Posted September 8, 2006 geeze... want me to come over and give personal instructions...... lol @DesktopDir & "\Server.dbs" works if it is on your desktop... you can use any folder you want 8) Link to comment Share on other sites More sharing options...
EWOlson Posted September 8, 2006 Share Posted September 8, 2006 geeze... want me to come over and give personal instructions...... lolCould you do that?! Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 geeze... want me to come over and give personal instructions...... lol@DesktopDir & "\Server.dbs"works if it is on your desktop... you can use any folder you want8)LOL, I know how to do it, thanks. I must have just done something wrong. it works greatthanks a bunch [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
Valuater Posted September 8, 2006 Share Posted September 8, 2006 Welcome 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 8, 2006 Moderators Share Posted September 8, 2006 ok, what i am trying to do, is find the location in a file where there is 17 unknown numbers, a space, and 17 other unknown numbers. I thought that StringRegExp could be used for it but I dont know how to use it. Can someone PLEASE HELP THANKS$sString = 'adkfjow 11111111122222233 44444444445555566 aldfoi' $aSRE = StringRegExp($sString, '([0-9]{17} [0-9]{17})', 3) If @extended Then For $iCC = 0 To UBound($aSRE) - 1 MsgBox(64, 'Info', $aSRE[$iCC]) Next EndIf Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
randallc Posted September 8, 2006 Share Posted September 8, 2006 Yes1 Or.. ;regsre.au3 #include<StringRegExpVBS.au3> $s_FileRead="zzzzz23478903467896745 23478903467896745cccc" $ar_Found=_StringRegExp($s_FileRead, '([\d]{17} [\d]{17})') $i_pos=StringInStr($s_FileRead,$ar_Found[0]) MsgBox(0,"","$i_pos="&$i_pos)Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
ConsultingJoe Posted September 8, 2006 Author Share Posted September 8, 2006 $sString = 'adkfjow 11111111122222233 44444444445555566 aldfoi' $aSRE = StringRegExp($sString, '([0-9]{17} [0-9]{17})', 3) If @extended Then For $iCC = 0 To UBound($aSRE) - 1 MsgBox(64, 'Info', $aSRE[$iCC]) Next EndIfthank you, I am interested in StringRegExp some more. I'm going to study it harder. thanks [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] 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