Advertisement
Guest User

Untitled

a guest
Jun 11th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.78 KB | None | 0 0
  1. Local $file = FileOpen(@ScriptDir & "\testfile.txt", 0)
  2.  
  3. ; Check if file opened for reading OK
  4. If $file = -1 Then
  5.     MsgBox(0, "Error", "Unable to open file.")
  6.     Exit
  7. EndIf
  8.  
  9. ; Read in 1 character at a time until the EOF is reached
  10. Local $chars = FileRead($file)
  11.     ;MsgBox(0, "Char read:", $chars)
  12.     ;$chars =StringReplace($chars, @CR, " ")
  13.     $chars =StringReplace($chars, @TAB, " ")
  14.     $chars = StringStripWS($chars, 7)
  15.     $chars =StringReplace($chars, " .", ".")
  16.     $chars =StringReplace($chars, " ,", ",")
  17.     $chars =StringReplace($chars, " ;", ";")
  18.     $chars =StringReplace($chars, " :", ":")
  19.     ;MsgBox(0, "Char read:", $chars)
  20.  
  21. FileClose($file)
  22.  
  23. Local $file2 = FileOpen(@ScriptDir & "\testfile2.txt", 42)
  24.  
  25.     FileWrite($file2, $chars)
  26.  
  27. FileClose($file2)
  28.  
  29. ;ClipPut($chars)
  30.  
  31. Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement