
vinnyMS
Active Members-
Posts
63 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
vinnyMS's Achievements

Wayfarer (2/7)
0
Reputation
-
the source file is attached result: @NPC_RedPlayer @NPC_Main_0_0 @NPC_Main_0_1 @NPC_Main_0_2 @NPC_Main_0_3 @NPC_Main_0_4 @NPC_Buy @NPC_Sell @NPC_TQuest @NPC_TQuest_1 01Meet_Bichon1-0.txt result.txt
-
i have a script that is supposed to extract text that includes or starts with the "@" character but it doesn't seem to work what is the problem with the regex? #include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> _Example() Func _Example() ; Error monitoring. This will trap all COM errors while alive. ; This particular object is declared as local, meaning after the function returns it will not exist. Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Local $oDictionary = ObjCreate("Scripting.Dictionary") Local $mypath = @ScriptDir Local $aFiles = _FileListToArrayRec($mypath, "*.txt", 1, 1) Local $aWords If @error Then MsgBox($MB_SYSTEMMODAL, "Error", "No files found") Exit Else MsgBox($MB_SYSTEMMODAL, "Found", $aFiles[0] & " files") EndIf Local $aWords For $i = 1 To $aFiles[0] $aWords = StringRegExp(FileRead($aFiles[$i]), "(?mi)^\s*(@.*)$", 3) ; change pattern to fit your definition of "word Local $iError = @error If $iError = 0 Then For $Word In $aWords $oDictionary.add($Word, $Word) Next Else ;;MsgBox($MB_SYSTEMMODAL, "Error", $aFiles[$i] & " - " & $i & @CRLF & "error: " & $iError) EndIf Next $aWords = $oDictionary.Items FileWrite("New AutoIt v3 Script - acomercial.txt", _ArrayToString($aWords, @CRLF)) EndFunc ;==>_Example ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc
-
create a Word Frequency Counter
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
post 1 is to create two lists, the before list and the after list -
create a Word Frequency Counter
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
Cool w me Greetings -
create a Word Frequency Counter
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
Not exactly homework That script was to use to extract text from hundreds of files and create a text list based on file content. Then the text extracted was to be replaced with text in another language. Extracted as Chinese and replaced by English. This way I could translate all those files by replacing the text from Chinese to English This other script is to create lists of top frequency to again replace from numbers to words. I work a lot with text file editing. I have all sort of ideas about programs -
create a Word Frequency Counter
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
-
create a Word Frequency Counter
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
Sorry to bother, I'm not a programmer so it's very difficult to create to me. It requires a lot of edits. Plz help -
i have a script that counts the word frequency and displays it in an array table i need it to write the results in a text file instead of an array table here's the script #Include <Array.au3> #Include <Debug.au3> #include <Constants.au3> #include <AutoItConstants.au3> Example() Func Example() $s = FileRead("2.txt") ProgressOn ( "Word Frequency", "Counting", "Loading", Default, Default, 18 ) Local $w = StringRegExp($s, "(?s)(\b[[:alpha:]]{2,}\b)", 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 ProgressSet (( $i/(UBound($w) - 1)) * 100, "processed", "word frequency" ) StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended Next ProgressSet(100, "Done", "Complete") _ArraySort($w, 1, 0, 0, 1) _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ; _DebugArrayDisplay($w, "Title", "|0:1") ; _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) $sMessage = "" SplashTextOn("Counting words", $sMessage, -1, -1, -1, -1, $DLG_TEXTLEFT, "") For $i = 1 To 0 $sMessage = $sMessage & $i & @CRLF Next ProgressOff() EndFunc ;==>Example
-
i have a word frequency counter script. the problem is that it counts 1 letter words and numbers i need the script to list only 2 or more letter words with no numbers #Include <Array.au3> #Include <Debug.au3> #include <Constants.au3> #include <AutoItConstants.au3> Example() Func Example() $s = FileRead("2.txt") ProgressOn ( "Word Frequency", "Counting", "Loading", Default, Default, 18 ) Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 ProgressSet (( $i/(UBound($w) - 1)) * 100, "processed", "word frequency" ) StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended Next ProgressSet(100, "Done", "Complete") _ArraySort($w, 1, 0, 0, 1) _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ; _DebugArrayDisplay($w, "Title", "|0:1") ; _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) $sMessage = "" SplashTextOn("Counting words", $sMessage, -1, -1, -1, -1, $DLG_TEXTLEFT, "") For $i = 1 To $w $sMessage = $sMessage & $i & @CRLF Next ProgressOff() EndFunc ;==>Example
-
add a progress bar to a script
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
it works, freezes for 10 seconds but loads -
add a progress bar to a script
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
i tried it again, it works with less content, if there's thousands of words it doesn't show progress it says "not responding" for many minutes here's what i have #Include <Array.au3> #Include <Debug.au3> #include <Constants.au3> #include <AutoItConstants.au3> Example() Func Example() $s = FileRead("book.txt") ProgressOn ( "Word Frequency", "Counting", "Loading", Default, Default, 18 ) Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 ProgressSet (( $i/(UBound($w) - 1)) * 100, "processed", "word frequency" ) StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended Next _ArraySort($w, 1, 0, 0, 1) _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ; _DebugArrayDisplay($w, "Title", "|0:1") ; _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ProgressOff() EndFunc ;==>Example -
add a progress bar to a script
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
#Include <Array.au3> #Include <Debug.au3> #include <Constants.au3> #include <AutoItConstants.au3> Example() Func Example() $s = FileRead("2.txt") ProgressOn("word frequency", "Increments every row", "0%", -1, -1, BitOR($DLG_NOTONTOP, $DLG_MOVEABLE)) Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended ProgressSet($i, $i & "%") Next _ArraySort($w, 1, 0, 0, 1) _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ProgressSet(100, "Done", "Complete") ; _DebugArrayDisplay($w, "Title", "|0:1") ; _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ProgressOff() EndFunc ;==>Example i almost got it working with a minor bug in percent value how to fix it? -
add a progress bar to a script
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
is it possible to add the progress bar and make it work for each array row result counting min/max rows completed -
i have this script that i need a progress bar about #Include <Array.au3> #Include <Debug.au3> #include <Constants.au3> $s = FileRead("book.txt") Local $w = StringRegExp($s, '(?is)(\b\w+\b)(?!.*\b\1\b)', 3) _ArrayColInsert($w, 1) For $i = 0 to UBound($w)-1 StringRegExpReplace($s, '(?i)\b' & $w[$i][0] & '\b', $w[$i][0]) $w[$i][1] = @extended Next _ArraySort($w, 1, 0, 0, 1) _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) ; _DebugArrayDisplay($w, "Title", "|0:1") ; _DebugArrayDisplay($w, "Title", "|0:1", $ARRAYDISPLAY_NOROW) plz help
-
ArrayDisplay copy array result values
vinnyMS replied to vinnyMS's topic in AutoIt General Help and Support
thanks a lot it works