Search the Community
Showing results for tags 'txt'.
-
Hello! I am new to autoit so please if someone could help me. I am trying to combine multiple .txt files but I can't get it right. In every file are the exact amout of lines ( for example here are 2 ) , I don't want to make it for just 2 lines for each txt files but for all the lines the txt files contains. The thing I want to do is : Text File 1 Hello my name I am a big ... Text File 2 is Fred, Potato head for ... Text File 3 and I like to eat pizza. Not getting this right. ... ------------------- Combine them all into one txt file like here ------------------------------ Final Text file Hello my name is Fred, and I like to eat pizza. I am a big Potato head for Not getting this right. ... Thanks for any advice! P.S. Sorry for my English, not my first language.
- 4 replies
-
- text
- combine documents
-
(and 2 more)
Tagged with:
-
Hello, I have a problem with getting first 10 characters with a big txt file, about 50k lines. I only want 10 characters of each line and save it into another file. I tried to use Stringleft every line and save it into another file but it was really slow to do it. I tried to save it into a variation like $var=$var&stringleft($file,10)&@CRLF. It's faster but still really slow. Can anybody help me with this Thank you so much
- 7 replies
-
- txt
- stringleft
-
(and 2 more)
Tagged with:
-
hi i use from Command Line net user /Domain UserID >> C:\temp\sample.txt to request informations about specific Domain User. Now i wil get Password last set, Password expires, password changeable and all Groups from Global Group Membership of this User to display in a MsgBox. With FUNC _readGroups i can check which position is group date of last password set but i don't know how to get needed informations as i wrote at the beginning. Thanks in advance for any hint how can i solve it. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.3 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <File.au3> $FilePath=@ScriptDir &"\sample.txt" $StringToSearch="Password last set" $CaseSense=0 $Lines=_FileCountLines($FilePath) $hFile=FileOpen($FilePath,0) $LinesCount=_FileCountLines($FilePath) For $i=0 To Number($Lines) $Test=FileReadLine($hFile,$i) If StringInStr($Test,$StringToSearch,$CaseSense) Then $foundLine = $i _readGroups($foundLine,$LinesCount,$i) ;MsgBox(0,"","The string " & $StringToSearch & " was found on line " & $i) ;MsgBox(0,"","Lines found: " & $LinesCount) ExitLoop EndIf Next FileClose($hFile) FUNC _readGroups($foundLine,$LinesCount,$i) ;For $j=$foundLine To Number($LinesCount) $lLine=FileReadLine($hFile,$i) ;$split = StringSplit($lLine," ") $split = StringSplit(StringStripWS($lLine,1)," ") For $x = 1 To $split[0] MsgBox(0,$x,$split[$x]) Next ;MsgBox(0,"",$split[15]& " " & $split[16]) ;Next EndFunc sample.txt
-
I have a file (see attached file) with a string all line and this problem on here is I want to separate all $00:, $03:, $10:, $20:, $25:, $30:, $40:, $45:, $110:, $115:, $120: and $T. It's mean that each $ with value start a new line ( a new paragraph). I tried with Regular Expression in notepad++ ex: Find ($00:, $01:, $03: and so on) with regex (\$)([0-9]+): and replace is \r\n\1\2 (I think \r\n is @CRLF (not sure :() ) Find $T with regex (\$T)(.*?)(\$T) and replace is \1\2\r\n\3 When I try these regex to replace in notepad on StringRegexReplace the results is incorrect . I have read some example simple about regex. Please advise me how to do that with some example on autoit . The result will be in attached photo. Thanks ahihi.txt
-
I am very new to Autoit and pretty new to scripting altogether.I have a PowerShell script that pulls owner info from folders on our file share server. There are 3 owners for every folder, Domain Admin, User setup for network scanning and the user. I am trying to copy the username only from this txt file. I have gotten as far as to being able to read the lines in the txt file but can't seem to read the columns. This is what i have so far. #include <File.au3> $file = "c:\test01.txt" FileOpen($file, 0) For $i = 5 to _FileCountLines($file) $line = FileReadLine($file, $i) msgbox(0,'','the line ' & $i & ' is ' & $line & 'and the column is') Next FileClose($file) This is the outcome..... This is the txt file I am trying to copy the ABC part without the MyDomain\. I know it's line 5 and columns 11-14 of the txt file but i can't figure out how to read it. I hope i'm explaining this correctly.
-
Hello guys, I would have the need to import into the GUICtrlCreateListView all * .txt files in a folder. The * .txt files contain all of the same formatting separated by "|", the script should go on every single file and bring me back the result in the GUICtrlCreateListView. For now I only managed to upload a single file * .txt into the GUICtrlCreateListView with this code: Case $Button_Find $File_txt = "\\cond\UPDATE\test.txt" Dim $Array_List _FileReadToArray($File_txt, $Array_List) $Limit_Array = UBound($Array_List) - 1 For $i = 1 To $Limit_Array $All_Box = String($Array_List[$i]) GUICtrlCreateListViewItem($All_Box, $List) Next For $i2 = 0 To _GUICtrlListView_GetColumnCount($List) _GUICtrlListView_SetColumnWidth($List, $i2, $LVSCW_AUTOSIZE_USEHEADER) Next
- 11 replies
-
- guictrlcreatelistviewitem
- txt
-
(and 1 more)
Tagged with:
-
Hi Guys, I'm working on this project: $Import = GUICtrlCreateButton("Import", 15, 175, 90, 40, $WS_GROUP) $List = GUICtrlCreateListView("Name|Address|E-mail", 15, 220, 400, 363, $LVS_SORTDESCENDING) $Item1 = GUICtrlCreateListViewItem("test|test|test", $List) GUISetState(@SW_SHOW, $GUI) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Exit Exit Case $Import $Table_Import = FileOpenDialog("Import list '*.txt'", @DesktopDir & "\", "Text (*.txt)") If @error Then ContinueLoop GUICtrlSetData($Item1, $Table_Import) In the text file the fields are delimited with "|" and the values are not in the same row but one below the other. However in the txt file the sum of the values may change. Can you help me? Thank's
- 19 replies
-
- guictrlcreatelistview
- txt
-
(and 1 more)
Tagged with:
-
#include <ColorConstants.au3>; Including required files #include <GUIConstantsEx.au3> #include <file.au3> #include <Array.au3> #include <string.au3> Example() Func Example() Local $hash Local $hashes = "hash.txt" _FileReadToArray($hashes, $hash) For $i = 1 To UBound($hash) - 500 $hashcheck = $hash[$i] $PDenc = "hash=" & $hashcheck & "&decrypt=Decrypt" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", "http://myurl/", False) ; Post url $oHTTP.SetRequestHeader("Host", "myurl") $oHTTP.SetRequestHeader("Connection", "keep-aliveContent-Length: 29") $oHTTP.SetRequestHeader("Cache-Control", "max-age=0") $oHTTP.SetRequestHeader("Origin", "http://myurl") $oHTTP.SetRequestHeader("Upgrade-Insecure-Requests", "1") $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8") $oHTTP.SetRequestHeader("Referer", "http://myurl") $oHTTP.SetRequestHeader("Accept-Language", "en-US,en;q=0.8") $oHTTP.Send($PDenc) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status sleep(2000) If $oStatusCode = 503 then MsgBox(4096, "Response code", $oStatusCode) ExitLoop EndIf ; Saves the body response regardless of the Response code $file = FileOpen("Received.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $oReceived) $read = FileRead("Received.html") ;read file if StringInStr($read, "not found") Then ContinueLoop Else ContinueLoop $Datastring = ('</script></div><br/>') $newreadamount = _StringBetween($read, $Datastring, "</b><br/><br/>") ;read title from file $newreadamount[0] = StringReplace($newreadamount[0], '<b>', "") ; taking out the X makes it easier to compare value If @error Then ContinueLoop EndIf $file = FileOpen("decrypted.txt", 1) FileWrite($file, $newreadamount[0] & @CRLF) EndIf Next sleep(2000) EndFunc ;==>Example As you can read my script loads 500 lines of text, lets say I have a list with 10.000 lines Is there a way to show a progressbar GUI to show how long in a text file I am? I may not know how long a particular .txt file is always so I am thinking I need some sort of algorythm? Thanks in advance. ( I just got unclear if I actually read 500 lines each attempt or if I start with 500 and add 1 to it each time? ) For $i = 1 To UBound($hash) - 500 ; LIke that ^ For $i = 500 To UBound($hash) - 500 ; or like this^ Thanks a lot.
-
http://www.****.com/123.php?id=5|http://www.***.com/services/123.php?id=16|http://www.123.com/questions/q.php?id=5|http://123.com/researcher/view_group.php?id=995|http://www.123.com/en/contest/|http://www.123.com/club/123.php?id=77| How can I sort a file like this in to a line by line .txt file?
-
Hi, i am creating a hotkey script for my work. Now i am hitting a wall, i have to be able to send a line of text using a combination of keys. The problem i have is not in the combination but in the line of text i am trying to send. What i am trying to send contains the symbol: ! Everytime i use my script it does send my line of text until it needs to send the ! First i tried: ControlSend("", "", "", "svm{$}8{4}{!}", 0) ControlSend("", "", "", "{enter}") Right now i changed the code to read the line of text from a ini file but still the problem. Maybe someone has any ideas?
-
I have very minimal knowledge of AutoIt. I come from basic/batch/vbscript/wisescript environment. I am learning AutoIt as I type this. I'm hoping someone can help me out / point me in the right direction. AutoIt has helped me in the past with many tasks. Again, I am a beginner here. I'm looking for a script that compares two text files (contains listing of files) and sorting out the differences. Once the differences have been sorted out, I want to delete the files that are "different." For example: [file1.txt content] c:dog.txt c:cat.txt c:mouse.txt [file2.txt content] c:dog.txt c:cat.txt c:mouse.txt c:bear.txt Logic: Difference = c:bear.txt Delete c:bear.txt Any help would be appreciated. -DS