JonF Posted 17 hours ago Posted 17 hours ago OK, this is insane. The following code: #include <FileConstants.au3> $InHandle = FileOpen('C:\Temporary\Deprecated0.html', $FO_READ) $OutHandle = FileOpen('C:\Temporary\Deprecated.html', $FO_OVERWRITE) While True $Line = FileReadLine($InHandle) If @error = -1 Then ExitLoop FileWriteLine($OutHandle, $Line) WEnd FileClose($InHandle) FileClose($OutHandle) With the attached file (produced by Pandoc from an MD file) produces a file over 1 Gb with infinite blank lines at the end. Deprecated0.html
Developers Jos Posted 17 hours ago Developers Posted 17 hours ago (edited) Works fine for me, so your case must be different. You are sure the code is exactly what you use to test with? Edited 17 hours ago by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Solution donnyh13 Posted 14 hours ago Solution Posted 14 hours ago I also tried your example, with only a resulting 1kb file. My only suggestion would be to replace If @error = -1 Then ExitLoop With If @error Then ExitLoop Being that you would have an infinite loop on your hands if something else failed when reading. LibreOffice UDF Scite4AutoIt Spell-Checker Using LibreOffice WPS Office adapter — Use MS Word UDFs with WPS Office! LibreOffice API Inspector tools Spoiler "Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."
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