NicePerson 1 Posted August 26, 2010 I want to make a script which will read a text file (which contains a long list of names) and write every name seperated . for example write a new file with : some text & first name from the first read text file and so on. how to start this? any example?? Share this post Link to post Share on other sites
majidemo 0 Posted August 26, 2010 Reading a File? $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $chars = FileRead($file, 1) If @error = -1 Then ExitLoop MsgBox(0, "Char read:", $chars) Wend FileClose($file) Writing to a File? $file = FileOpen("test.txt", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, "Line1") FileWrite($file, "Still Line1" & @CRLF) FileWrite($file, "Line2") FileClose($file) or you can use the FileReadLine or FileWriteLine... Share this post Link to post Share on other sites