Jump to content

Recommended Posts

Posted

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

  • Solution
Posted

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."

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...