Guest User

Untitled

a guest
Jul 24th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.84 KB | None | 0 0
  1. #include <Array.au3>
  2. #include <File.au3>
  3. #include <MsgBoxConstants.au3>
  4.  
  5. ;Opt("TrayIconHide", 1)
  6. Opt("TrayIconDebug", 1)
  7. Opt("WinTitleMatchMode", 2)
  8. Opt("WinWaitDelay", 500)
  9.  
  10. pdf_strip()
  11.  
  12. Func pdf_strip()
  13.     Local $aArray, $j = 0, $end_array[1], $file
  14.     If FileExists(@ScriptDir & "\book-test.txt") = 0 Then
  15.         MsgBox(0, "File book-test.txt missing", "Place it in the same folder", 5)
  16.         Exit
  17.     EndIf
  18.     _FileReadToArray(@ScriptDir & "\book-test.txt", $aArray)
  19.     For $i = 5 To UBound($aArray) - 1
  20.         If StringLeft($aArray[$i], 6) <> "Page: " And StringLeft($aArray[$i], 6) <> "------" And StringLeft($aArray[$i], 8) <> "Author: " Then
  21.             _ArrayInsert($end_array, 0, StringStripWS($aArray[$i], 3))
  22.         EndIf
  23.     Next
  24.     _ArrayReverse($end_array)
  25.     _ArrayDelete($end_array, 0)
  26.  
  27.     _FileWriteFromArray(@ScriptDir & "\book-final.txt", $end_array, 0)
  28. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment