-
Posts
3,849 -
Joined
-
Days Won
63
mikell last won the day on February 13 2023
mikell had the most liked content!
About mikell
Profile Information
-
Member Title
RIP: Soulful cat
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
mikell's Achievements
-
Parsix reacted to a post in a topic: Smoothing Rounded Corners GUI
-
Danyfirex reacted to a post in a topic: HTTPS Post and Request
-
pixelsearch reacted to a post in a topic: compare 2 arrays with 3 arrays as a result
-
Norm73 reacted to a post in a topic: compare 2 arrays with 3 arrays as a result
-
NassauSky reacted to a post in a topic: how to drag a window without titlebar
-
TOOD reacted to a post in a topic: How to WinExist('[CLASS:#32770]') with Button1?
-
mikell reacted to a post in a topic: Slow Comboboxes and GUISetState(@SW_DISABLE, $hGUI) still updates GUI
-
Musashi reacted to a post in a topic: Slow Comboboxes and GUISetState(@SW_DISABLE, $hGUI) still updates GUI
-
It should... But as _IE* funcs are efficient and reliable but slow, when it is possible I personally often choose the string/regex way $txt = "<tr class=""web-row-style"">" & @crlf & _ " <td>1</td>" & @crlf & _ " <td>24/12/2023 09:33:21</td>" & @crlf & _ " <td>55801</td> " & @crlf & _ " </tr>" & @crlf & _ @crlf & _ @crlf & _ "<tr class=""web-alternating-row"">" & @crlf & _ " <td>2</td>" & @crlf & _ " <td>24/12/2023 08:51:30</td>" & @crlf & _ " <td>48887</td>" & @crlf & _ " </tr>" & @crlf & _ @crlf & _ "<tr class=""web-row-style"">" & @crlf & _ " <td>3</td>" & @crlf & _ " <td>23/12/2023 10:51:32</td>" & @crlf & _ " <td>289261</td> " & @crlf & _ " </tr>" ; Msgbox(0,"", $txt) $id = "48887" $res = StringRegExpReplace($txt, '(?s).*<td>(.*?)</td>\s*<td>' & $id & '</td>.*', "$1") Msgbox(0,"", @extended = 0 ? "id not found" : $res)
-
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
Sorry, while my snippet works I didn't test yours #include <Date.au3> $sDateTime = "25/12/2023 14:59:30" $res = Execute("'" & StringRegExpReplace($sDateTime, "(\d+)/(\d+)/(\d+) (\d+):(\d+).*", _ "' & _DateToMonth('$2',1) & ' $1 $3 ' & ('$4'>12 ? StringFormat('%02i', '$4'-12) & ':$5PM' : '$4:$5AM') & '") & "'") Msgbox(0,"", $res) -
Maybe the array way ?
-
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
Great -
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
You might also try the screwy way - meaning regex (what else ?) #include <Date.au3> $sDateTime = "25/12/2023 18:50:30" $res = Execute("'" & StringRegExpReplace($sDateTime, "(\d+)/(\d+)/(\d+) (\d+):(\d+).*", _ "' & _DateToMonth('$2',1) & ' $1 $3 ' & ('$4'>12 ? StringFormat('%02i', '$4'-12) & ':$5PM' : '$4:$5AM') & '") & "'") Msgbox(0,"", $res) -
Musashi reacted to a post in a topic: How to add random seconds to Date/Time?
-
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
Even if the UDF doesn't allow to make your custom conversion in one go, it's certainly doable using several successive steps -
Exactly what I meant. Using _IETableWriteToArray you get a 2D array which contains DateTime and the corresponding User ID on the same rows
-
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
For this I highly suggest to use the Melba's UDF , Musachi provided the link some posts above -
Personally I'd rather try something like this Local $oTds = _IETableGetCollection($oIE) For $oTd In $oTds $table = _IETableWriteToArray($oTd) _ArrayDisplay($table) Next and get a 2D array to work with
-
How to add random seconds to Date/Time?
mikell replied to jmp's topic in AutoIt General Help and Support
You might try this - the regex is exactly the one which is in the help file #include <Date.au3> $iwebdate = "24/12/2023 00:00:15" ; convert $c = StringRegExpReplace($iwebdate, '(\d+)/(\d+)/(\d+)(.*)', "$3/$2/$1$4") ; MsgBox(0, "", $c) $sNewDate = _DateAdd('s', Random(2, 8, 1), $c) ; MsgBox(0, "", $sNewDate) ; convert back $c = StringRegExpReplace($sNewDate, '(\d+)/(\d+)/(\d+)(.*)', "$3/$2/$1$4") MsgBox(0, "", $c) -
mikell reacted to a post in a topic: File to Base64 String Code Generator v1.20 Build 2020-06-05 (embed your files easily)
-
Split a file (string) by empty lines
mikell replied to queensoft's topic in AutoIt General Help and Support
Regex too but simpler way, works regardless of the newline #include <Array.au3> $file = @ScriptDir & '\The.Girl-UTF.srt' $a = StringRegExp(FileRead($file), '(?s)(\N.+?(?=\R{2}|$))', 3) _ArrayDisplay($a) $sFile = @ScriptDir & '\The.Girl2-ANSI.srt' $a = StringRegExp(FileRead($sFile),'(?s)(\N.+?(?=\R{2}|$))', 3) _ArrayDisplay($a) -
Musashi reacted to a post in a topic: Regex how to?
-
$txt = "Connection mode : Profile" & @crlf & _ " Channel : 4" & @crlf & _ " Receive rate (Mbps) : 300" & @crlf & _ " Transmit rate (Mbps) : 65" & @crlf & _ " Signal : 83%" & @crlf & _ " Profile : AndroidAP_4013" & @crlf & _ @crlf & _ " Hosted network status : Not available" Msgbox(0,"", StringRegExp($txt, 'Profile\h*:\h?(.*)', 1)[0] ) Use \h? to avoid matching a space between the colon and the A
-
StringReplace next only from the previous position onwards
mikell replied to leuce's topic in AutoIt General Help and Support
Maybe this... $sd = ObjCreate("Scripting.Dictionary") $sd.add("1104", "nbs1") $sd.add("1105", "nbs2") $sd.add("1106", "nbs3") $sd.add("1107", "nbs4") $str = '<trans-unit translate="no" id="bf7c95b8-58a9-4352-988c-7679b8942d49"><source><x id="1103"/><x id="1104"/>' & _ '</source></trans-unit><trans-unit id="47e1477a-98e9-4759-997f-a4e722e63ce5"><source>The quick brown fox<x id="1105"/>' & _ 'ABCDE</source><seg-source><mrk mtype="seg" mid="180">Jumps over the lazy dog<x id="1106"/>FGHIJ</mrk></seg-source>' & _ '<target><mrk mtype="seg" mid="180"/></target><sdl:seg-defs><sdl:seg id="180"/></sdl:seg-defs></trans-unit>' & _ '<trans-unit translate="no" id="aa1f3715-586f-437b-8d7b-d2324b27fc8d"><source><x id="1107"/><x id="1108"/></source></trans-unit>' $r = Execute("'" & StringRegExpReplace($str, "(<x id=""(\d{4})"")/>", _ "' & ($sd.exists('$2') ? '$1 ctype=""' & $sd.item('$2') & '""/>' & $sd.remove('$2') : '$1/>') & '") & "'") Msgbox(0,"", $r) Each replacement will be done only once -
gcue reacted to a post in a topic: trying to first and last name only
-
trying to first and last name only
mikell replied to gcue's topic in AutoIt General Help and Support
or this ;$string = "bob smith cima, phd, ma" $string = "brian o'connor cima, phd, ma" $res = StringRegExpReplace($string, '^([[:alpha:]'']+) ((?1)).*', "$2, $1") MsgBox(0,'', $res)