Created
October 12, 2011 05:02
-
-
Save summerwxy/1280338 to your computer and use it in GitHub Desktop.
text file parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| F2:: | |
| FileSelectFile, sfile, 3, , Pick a text file. | |
| if sfile = | |
| { | |
| MsgBox, no file selected | |
| return ; exit in this case | |
| } | |
| SplitPath, sfile, , sfilePath, sfileExt, sfileNoExt | |
| if sfileExt <> txt | |
| { | |
| MsgBox, only for txt file | |
| return | |
| } | |
| dfile = %sfilePath%/%sfileNoExt%_RESULT.txt | |
| IfExist, %dfile% | |
| { | |
| MsgBox, 4, , Overwrite the existing result file: %dfile% ? | |
| IfMsgBox, Yes | |
| FileDelete, %dfile% | |
| } | |
| Loop, read, %sfile%, %dfile% | |
| { | |
| ; rule here.... | |
| if StrLen(A_LoopReadLine) < 50 | |
| continue | |
| IfInString, A_LoopReadLine, 000 | |
| continue | |
| FileAppend, %A_LoopReadLine%\n | |
| } | |
| MsgBox, Finish... | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment