Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Remove Duplicate lines through RegExp

$
0
0
Something problem from mount...What's wrong with this code?
Thanks so much :lol:

[ autoit ]      
#include <Array.au3> #include <File.au3> Dim $aArray $opentxt = FileOpenDialog('Choose TXT', @DesktopDir, '(*.txt)', 1, '') $aRegExp = StringRegExp(FileRead($opentxt), "[0-9]{6,12}", 3) $startmount = Ubound($aRegExp) ;<<<<<Maybe get wrong from here _FileReadToArray($opentxt, $aArray) _ArrayDelete($aArray, 0) $newfile = _ArrayUnique($aArray) $outputtxt = FileOpen($opentxt, 2) _FileWriteFromArray($outputtxt, $newfile, 1) FileClose($opentxt) $sRegExp = StringRegExp(FileRead($opentxt), "[0-9]{6,12}", 3) $endmount = Ubound($sRegExp) ;<<<<<And here MsgBox(0, "Mount", "Before: " &$startmount  &@CRLF &"After: " &$endmount  &@CRLF &"Total Deplicate: " &($startmount - $endmount))

Elson :)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>