Sign in to follow this  
Followers 0
soad1982

AWK Like Linux on Autoit

4 posts in this topic

Hey, Im trying to get from the Local $var = "10:12:03" the second value beteween the : : and save it on another variable.

I cannot use StringRegExpReplace because the "12" is not always "12". In Linux I would use awk searching the pattern : and print $2, but I have no idea how to make it work using autoit.

Thanks in advance.

-Jose

Share this post


Link to post
Share on other sites



This was really easy.I choose at the end the spit command.

aEvent = "10:50:2"

$Time = StringSplit($aEvent, ":")

If $Time[0] >= $HOUR Then ;Compare Hour

If $Time[1] >= @MIN Then ; Compare Minute

Thanks.

Share this post


Link to post
Share on other sites

Regular Expressions are fun and powerful! As a perl developer I *heart* regular expressions.

$array = StringRegExp("12:34:45", '(\d?\d):(\d\d):(\d\d)', 2)
MsgBox(0, "Time Parts", "Full Time is... " & $array[0] & " Hours Are " & $array[1] & " Minutes Are " & $array[2] & " Seconds Are " & $array[3])

AutoIt changed my life.

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