Remove CR as end of line marker with dos script

I have a file and each file have in the end CRCRLF end or line marker. I have to remove CR to have file in windows format (leave CRLF). How is it possible to do with MS Dos bat file?
caljuAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SteveGTRCommented:
I created the following batch file that should do the trick:

@echo off

if "%~1"=="" echo Please enter file name.&goto :EOF
if not exist "%~1" echo %~1 does not exist.&goto :EOF

for /f "tokens=1,* delims=:" %%a in ('findstr /N /V _DONOTFIND_ "%~1"') do call :PROCESS "%%b"

goto :EOF

:PROCESS

if "%~1"=="" (echo.) else (echo %~1)

If you named the file REMOVECR.BAT and your input file name was input.txt, you could say:

removecr input.txt >output.txt

The results would be placed in output.txt.

Good Luck,
Steve
caljuAuthor Commented:
If I put inside file like this then only thing I'm getting out is: COMMENT:TEXT=


COMMENT:TEXT="          TNK   "Y COMMENT:TEXT="Sales Receipt 29-MAR-2006                "Y

COMMENT:TEXT=""> SALE:NAME="TICKET ";AMOUNT=         100.00 ;TAXPERCENTS=0| COMMENT:TEXT=""| COMMENT:TEXT=""; COMMENT:TEXT="Signature_______________________________"| COMMENT:TEXT=""| COMMENT:TEXT="Booking: 5425726          "| COMMENT:TEXT="30.03.2006 12.26-HP1268931"| COMMENT:TEXT=""| TENDER:TENDERID="Cash";NAME="sk.nauda";AMOUNT=         100.00 |
SteveGTRCommented:
That is a little tricky. How about this:

@echo off

setlocal enabledelayedexpansion

if "%~1"=="" echo Please enter file name.&goto :EOF
if not exist "%~1" echo %~1 does not exist.&goto :EOF

for /f "tokens=1,* delims=:" %%a in ('findstr /N /V _DONOTFIND_ "%~1"') do (
  if "%%b"=="" (echo.)
  else (
    set line=%%b

    if /i "!line:~-1,1!" GEQ " " (echo !line:~0,-1!) else (echo %%b)
  )
)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.