WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Convert Linefeeds (LF) to Carriage Return Linefeeds (CRLF)

Keywords: Fileread CRLF LF Carriage return line feed

The example code has not been debugged, first make a backup copy of your original file.

The basic idea here is that you load the file into a binary buffer, and then replace all the LFs with CRLFs.

   
;Replace LF with CR/LF  (DOSize the file)
fn = "C:\temp\unix.txt"
fs = FileSize(fn)
bb = BinaryAlloc(fs*2)
BinaryRead(bb,fn)
BinaryReplace(bb,@LF,@CRLF,@True)
BinaryWrite(bb,fn)
BinaryFree(bb)
Message("All","Done")

Article ID:   W13075
Filename:   FileRead on Files with LF Endings.txt
File Created: 2001:01:15:10:35:28
Last Updated: 2001:01:15:10:35:28