LoneWolf_2106 Posted June 28, 2017 Posted June 28, 2017 Hi everybody, i have a simple question, i have a text file with empty rows, i want to remove/delete them. Is there any function which might help me? Thanks in advance. Regards
Gianni Posted June 28, 2017 Posted June 28, 2017 ... one of possible ways: #include <FileConstants.au3> $handle = FileOpen("BlankLines.txt") ; open file (read mode) $sContent = FileRead($handle) ; read content FileClose($handle) Do ; remove double carriage-returns (white lines) $sContent = StringReplace($sContent, @CRLF & @CRLF, @CRLF) Until Not @extended $handle = FileOpen("No_BlankLines.txt", $FO_OVERWRITE) ; write result in a new file FileWrite($handle, $sContent) FileFlush($handle) FileClose($handle) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now