Link to home
Start Free TrialLog in
Avatar of Shalver
Shalver

asked on

Carriage Return in Batch File

I need to create a batch file that gets rid of the carriage return. The delimiter looks like a square [].

I attached what the file looks like and highlighted what I see the carriage return as and also another file what the expected output is ..

Any ideas how this can be accomplished
carriage-return.PNG
carriage-return---how-it-should-look.PNG
Avatar of Bill Prew
Bill Prew

Two things to try and see if it helps.  Either:

type filein.txt > fileout.txt

or

more filein.txt > fileout.txt

~bp
Avatar of Shalver

ASKER

I started something like this but it definitely is not correct !!!

@echo off
    setlocal enableextensions disabledelayedexpansion

    set "first=1"
    <nul (
      for /f "usebackq delims=" %%a in ("Carfinance2.txt") do (
        if defined first (set /p ".=%%a" & set "first=") else (set /p ".=,%%a")
      )
    ) >"output.txt"
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shalver

ASKER

This solution worked ! Thank you very much
Welcome.