Solved! Convert CRLF to LF

Status
Not open for further replies.
Oct 24, 2018
3
0
10
Hello

i was wondering if you can assist in my batch file. i would the output file to be UNIX line ending (LF), however its defaults it to CRLF. I have been looking for 2 weeks for an answer. thanks.



@echo off
set "first=Yes"
(for %%a in ("H:\data dumps\folder\combine\*.csv") do (
if defined first (
type "%%a"
set "first="
) else (
more +1 "%%a"
)
))>"H:\data dumps\folder\combine\test.csv"
 
Solution
This is a dead simple search/replace in VBA. In VBA just walk the file and replace all instances of vbCrLf (or vbNewLine, as they are the same thing) with vbLf
Oct 24, 2018
3
0
10


thank you for your reply.

Ideally I would like to automate this, without the use of Notepad or other utilities.

Use of CMD, batch, or VBA is what I need.

 
Status
Not open for further replies.