Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: FileWrite Adds CRLF
For instance this code:
hh = FileOpen("C:\temp\test.txt","Write") For x = 1 to 5 FileWrite(hh,"ABC") FileWrite(hh,"123") FileWrite(hh,"XYZ") FileWrite(hh,"789") next FileClose(hh)should create a file with 20 lines. In reality, it adds an additional blank line at the end of the file. How can I keep that line from being added to the output file?
FileWrite, by default, adds a CRLF to the end of every string you write.
In this case a line is defined as 0 or more normal characters followed by a CRLF character pair.
When I tested the script, that is exactly what I got.
However I surmise that you wish to perhaps not add the final CRLF on the end?
Or perhaps you are looking at it in WinBatch Studio that seems like to make sure the end of the file has a CRLFRLF on the end and thus confuses the issue?
In any case you can use IntControl 53 to take control of the kind of endings yourself and write out exactly what text you want.
Article ID: W15501
File Created: 2003:05:13:11:28:22
Last Updated: 2003:05:13:11:28:22