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

Seeker (1/7)
0
Reputation
-
here's an example of the text file before and after option: remove lines containing "items4" there's 200k lines to be removed in 1 million lines.the lines removed have to stay empty (like in the screenshot), it's a must
-
i have a text file with 1 million lines where i have to remove 800k lines. i want to remove the 800k lines and keep the 200k lines but the line order has to remain the same. lines removed should become empty lines so there should still be 1 million lines but only 200k with text
-
delete text files with same text content
way1000 replied to way1000's topic in AutoIt General Help and Support
-
delete text files with same text content
way1000 replied to way1000's topic in AutoIt General Help and Support
now i have this script but it says that files are different even if files are the same #include <File.au3> #include <array.au3> Dim $aFile1, $aFile2, $aUnique, $array1, $array2 _FileReadToArray(@Scriptdir & "\file1.txt",$aFile1,0) ;read file 1 into zero based array $aFile1 _FileReadToArray(@Scriptdir & "\file2.txt",$aFile2,0) ;read file 2 into zero based array $aFile2 if UBound($aFile1) = UBound($aFile2) Then ;if both arrays have same size _ArrayConcatenate($aFile1,$aFile2) ;merge a2 into a1 $aUnique = _ArrayUnique($aFile1,0,0,0,0) ;generate zero based array of unique lines in A1 EndIf msgbox(1,"RESULT",(UBound($aFile2) = UBound($aUnique)) ? "Files are the same" : "Files are different") For $x = 0 to Ubound($array1)-1 For $y = 0 to Ubound($array2)-1 ;is $array1[$x] a match with $array2[$y] ;if yes store path of file in $array2[$y] in $array3 to delete at the end ;or delete $array2[$y] as you go and check for errors when reading files in Next Next ;delete all the files in $array3 how to fix it -
i have to delete many files with same text content even if the order of text lines is different in each text file so i need some help to create a solution eg: file1.txt: text line a text line c text line b deleted: file2.txt: text line a text line b text line c same text content exactly but different text line order it has to have an option to browse folder and batch delete files with duplicate text content of different line order
-
input a word and replace its letters as output
way1000 replied to way1000's topic in AutoIt GUI Help and Support
hi, here's what i have already #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 393, 281, 513, 142) $Input1 = GUICtrlCreateInput("word", 16, 16, 361, 21) GUICtrlCreateEdit("", 16, 48, 361, 177) $Button1 = GUICtrlCreateButton("Replace", 16, 240, 75, 25) $Button2 = GUICtrlCreateButton("Save", 96, 240, 75, 25) $Button3 = GUICtrlCreateButton("Close", 176, 240, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd -
input a word and replace its letters as output
way1000 posted a topic in AutoIt GUI Help and Support
i'm trying to create a program that let's the user type a word in an input field (gui) and when a button is pressed the letters of the word are replaced by 1 word each from a list of words in a text file i created the gui for it but i need help to add some more code to make it work like intented each letter of a word should be replaced by a word from a text file the text file is a source for replacing letters is a file with 2 columns separated by tab that contains the entire alphabet (26 rows) please help if possible i posted an example gui screenshot -
i have a script, it runs but doesn't throw an error or writes anything #include <Array.au3> ; Only required to display the arrays #include <File.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Example() Func Example() Local $sAutoItDir = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1)) If StringRight($sAutoItDir, 5) = "beta\" Then $sAutoItDir = StringTrimRight($sAutoItDir, 5) EndIf ConsoleWrite($sAutoItDir & @CRLF) $aArray = _FileListToArrayRec($sAutoItDir, "*.txt", $FLTAR_FILES) _FileWriteToLine("$aArray", 3, "$sFileRead", False) Local $hFileOpen = FileOpen("C:\Users\user\Desktop\sourcefile.txt", $FO_READ) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf ; Read the fist line of the file using the handle returned by FileOpen. Local $sFileRead = FileReadLine($hFileOpen, 1) ; Close the handle returned by FileOpen. FileClose($hFileOpen) EndFunc ;==>Example
-
how can i make it work so it inserts lines from a source text file to many text files (1 line each) eg: "my insertion" an array of lines from a source text file and "C:\Users\user\Desktop\New Text Document.txt" many files in a folder
-
thanks a lot for your help now i have a script that inserts a specific line of text on a line number in a specified target file. but i cant make the target file an array of target files and the text line an array of text lines (the source is a text file), i don't know how #include <File.au3> ; Example: Write to line 3 of c:\temp\test.txt NOT REPLACING line 3 _FileWriteToLine("C:\Users\user\Desktop\New Text Document.txt", 3, "my insertion", False) thanks a lot in advance
-
i have many text files with "[@Description]" as the first line i have to insert lines from a text file full of phrases to the text files that start with "[@Description]" eg: sourcefile.txt line1 line2 ... targetfile1.txt [@Description] line1 targetfile2.txt [@Description] line2 thanks a lot in advance
-
thanks a lot
-
how can i make the above script work? i get "Error", "This file isn't supported by GDIPlus!"
-
thanks a lot i tried to create it differently but i'm stuck again with 1 error message #include <GDIPlus.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Example() Func Example() Local $aDim, $hImage, $sFile, $iX, $iY Local $aScriptDir = _FileListToArray("C:\tmp\iddle\iddle 1") ;instead of test.txt this has to be text files that take the names of the image files Local $sfile = FileOpen("test.txt", 1) _GDIPlus_Startup() $hImage = $aScriptDir & "*.png" $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) If @error Or Not $hImage Then MsgBox(BitOR($MB_TOPMOST, $MB_ICONERROR), "Error", "This file isn't supported by GDIPlus!") Else $aDim = _GDIPlus_ImageGetDimension($hImage) FileWriteLine($MB_ICONINFORMATION, $sFile & @CRLF & @CRLF & "Width = " & $iX & @CRLF & "Height = " & $iY) _GDIPlus_ImageDispose($hImage) FileClose($sfile) EndIf _GDIPlus_Shutdown() EndFunc ;==>Example
-
i edited a script but i cant seem to make it so it writes the height and width of images on a folder in text files which have to be txt files of the same name as image file names i tried to add everything i found in the help file that could make it work, but i got stuck so i need help #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <WinAPI.au3> Global $g_idMemo Example() Func Example() Local $hImage, $hGUI, $hDC, $tSize Local $sPath = "C:\tmp\iddle\iddle 1" Local $file = FileOpen($sPath & ".txt", 1) $hGUI = GUICreate("ImageList Get Icon SizeEx", 400, 300) $g_idMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0) GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) ; Load images $hImage = $sPath & ".png" ;_GUIImageList_AddBitmap($hImage, $sPath & ".png") _WinAPI_ReleaseDC($hGUI, $hDC) ; Show image list icon size $tSize = _GUIImageList_GetIconSizeEx($hImage) MemoWrite("Image width : " & DllStructGetData($tSize, "X")) MemoWrite("Image height: " & DllStructGetData($tSize, "Y")) FileWriteLine($file, $tSize) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite