edy Posted October 7, 2004 Posted October 7, 2004 hi all I have a string like "10/6/04 7:59 AM" and i want to extract hours and minutes (7:59) how can i obtain it? Thanks
CyberSlug Posted October 7, 2004 Posted October 7, 2004 $example = "10/6/04 7:59 AM" $time = StringSplit($example, " ") MsgBox(4096, "Result", $time[2]) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
ezzetabi Posted October 7, 2004 Posted October 7, 2004 To avoid keeping a unneeded array in memory you can change to: $eg = "10/6/04 7:59 AM" $time = StringSplit($eg, " ") $time = $time[2] MsgBox(4096, "Result", $time) I love variants
AutoChris Posted October 7, 2004 Posted October 7, 2004 ezzetabi: Cute signature, but just as an FYI, you are missing a "1" at the end of your first binary string. It should be "001001001"
JSThePatriot Posted October 7, 2004 Posted October 7, 2004 I am guessing that means ezzitabi loves autoit? JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
scriptkitty Posted October 7, 2004 Posted October 7, 2004 $Nakoruru from what I see, but I was never into Binary. ezzitabi loves autoit would roughly be: 01100101 01111010 01111010 01101001 01110100 01100001 01100010 01101001 00100000 01101100 01101111 01110110 01100101 01110011 00100000 01100001 01110101 01110100 01101111 01101001 01110100 AutoIt3, the MACGYVER Pocket Knife for computers.
ezzetabi Posted October 7, 2004 Posted October 7, 2004 Wow, I never thought that someone actually tried to read it. Ok... Time to change it SerialKiller you are right, thanks.
JSThePatriot Posted October 7, 2004 Posted October 7, 2004 Geeze... I know that is Hex... (I think) I dont know how to read either hex or binary.. I would like to though... I just had to learn how to convert between the different numbering sceme's JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
scriptkitty Posted October 7, 2004 Posted October 7, 2004 I like the binary one for looks, but content of your new one is better. AutoIt3, the MACGYVER Pocket Knife for computers.
friends Posted October 10, 2004 Posted October 10, 2004 $example = "10/6/04 7:59 AM"$time = StringSplit($example, " ")MsgBox(4096, "Result", $time[2])<{POST_SNAPBACK}>I have tested using the StringSplit ($example, " ") -> which is empty space,however it didn't work out to my case....Example : 3300110025841204 Name goes here 28,540 3300110025841385 Name goes here 12,569 3300110025842854 Name goes here 5,874For the above case... I wonder why the StringSplit() does not work ?I've tested, it displays EMPTY by using MsgBox()What I want is, to display 2 things:1) a bunch of numbers (1st column)2) name (2nd column)Please advise. Thank you
edy Posted October 10, 2004 Author Posted October 10, 2004 I have tested using the StringSplit ($example, " ") -> which is empty space,however it didn't work out to my case....Example :For the above case... I wonder why the StringSplit() does not work ?I've tested, it displays EMPTY by using MsgBox()What I want is, to display 2 things:1) a bunch of numbers (1st column)2) name (2nd column)Please advise. Thank you<{POST_SNAPBACK}>Each space will be returned as an element :$example = "3300110025841204 Name goes here 28,540"$time = StringSplit($example, " ")MsgBox(4096, "Result", $time[0])MsgBox(4096, "Result", $time[37])$time[0] is numer of elements (37)the second msgbox display 28,540bye
scriptkitty Posted October 11, 2004 Posted October 11, 2004 Yea, you can have autoit clean up your code, and then output the data.ex:$x=" 3300110025841204 Name_goes_here 28,540" split($x) $x=" 3300110025841385 Name_goes_here 12,569" split($x) $x=" 3300110025842854 Name_goes_here 5,874" split($x) func split($_x) $_xarray=Stringsplit($_x," ") for $i=1 to $_xarray[0] if $_xarray[$i]="" then continueloop msgbox(1,$_xarray[$i],"") next endfuncsince you stringsplit by space, then "Name goes here" would cause a problem.If you have a lot of this data, I would use something with regular expressions. It can make 2-20 spaces into say a | and then you could just stringsplit by |.Use autoit to run a command line version or have autoit run it's GUI. I do that a lot with XML data. AutoIt3, the MACGYVER Pocket Knife for computers.
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