reb Posted August 10, 2013 Posted August 10, 2013 I want to get the date such as April 17, 2012 I can not get Apr=il 17, 2012 as yet What am I doing wrong? REB global $Info[4] $Info[0] = '"dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Apr=il 17, 2012</b></font><br /><br/></td>' $Info[1] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jun=e 03, 2013</b></font><br /><br/></td>' $Info[2] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Aug=ust 02, 2012</b></font><br /><br/></td>' $Info[3] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jan=uary 20, 2012</b></font><br /><br/></td>' ;~ $Info[4] = ' for $i = 0 to 3 $date = $Info[$i] $Start = StringInStr($Date, "of ")+1 ;~ MsgBox(0,$i & "$start",$Start) $Stringlength = StringLen($date) $Intermediate = StringRight($date,$Stringlength - $Start) ;~ MsgBox(0,$i & " $Intermediate",$Intermediate) ;~ $End = StringInStr($Intermediate,"<",0,1,1,20) $end = StringInStr ($Intermediate,",",0,1) $Stringlength2 = StringLen($Intermediate) ;~ MsgBox(0,$i & " Final",StringLeft($Intermediate,$Stringlength2 - $end )) ConsoleWrite(StringLeft($Intermediate,$Stringlength2 - $end ) & " " & $i & @CRLF) Next MEASURE TWICE - CUT ONCE
jaberwacky Posted August 10, 2013 Posted August 10, 2013 These strings come from where? A website, text file, hardcoded into the source? Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
reb Posted August 10, 2013 Author Posted August 10, 2013 They come from Windows live mail "Filename.eml" I hard coded some I had extracted from my E-Mails for my example Thank for the reply REB MEASURE TWICE - CUT ONCE
Solution Edano Posted August 10, 2013 Solution Posted August 10, 2013 ;http://www.autoitscript.com/forum/topic/153496-string-extraction-problem/ ;Post #1 ;D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\SLICER\Avatar\default_large.png ;by reb ;Script grabbed by SLICER by Edano here: http://www.autoitscript.com/forum/topic/152402-slicer-autoit-forum-script-grabber/?p=1093575 global $Info[4] $Info[0] = '"dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Apr=il 17, 2012</b></font><br /><br/></td>' $Info[1] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jun=e 03, 2013</b></font><br /><br/></td>' $Info[2] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Aug=ust 02, 2012</b></font><br /><br/></td>' $Info[3] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jan=uary 20, 2012</b></font><br /><br/></td>' ;~ $Info[4] = ' for $i = 0 to 3 $date = $Info[$i] $t=StringSplit($date,"of ",1) If $t[0]>1 Then $ret=StringSplit($t[2],"<") ConsoleWrite($ret[1] & " " & $i & @CRLF) EndIf Next [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]
jaberwacky Posted August 10, 2013 Posted August 10, 2013 They come from Windows live mail "Filename.eml" I hard coded some I had extracted from my E-Mails for my example Thank for the reply REB Then I think the StringReplace(...) function will suit your needs. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
reb Posted August 10, 2013 Author Posted August 10, 2013 @ Edano Works great! Never would have thought of that. Thank you very much REB MEASURE TWICE - CUT ONCE
0xdefea7 Posted August 10, 2013 Posted August 10, 2013 global $Info[4] $Info[0] = '"dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Apr=il 17, 2012</b></font><br /><br/></td>' $Info[1] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jun=e 03, 2013</b></font><br /><br/></td>' $Info[2] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Aug=ust 02, 2012</b></font><br /><br/></td>' $Info[3] = 'dana, Arial, Helvetica, sans-serif" ><b>Your account balance(s) as of Jan=uary 20, 2012</b></font><br /><br/></td>' For $i = 1 To 4 StringReplace($Info[$i], "=", "") Next As suggested above is cleaner..
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