How to remove End-of-line chars from a .TXT?

August 16, 2010 at 05:39:02
Specs: DOS, 286


how can I remove EOL characters from a text file?

I have a text file containing multiple lines, I wish that all lines appear as one line.
Do you know any DOS tool to remove the EOL characters?

The littel fox jumps

Thank you!

See More: How to remove End-of-line chars from a .TXT?

Report •

August 20, 2010 at 22:28:54

download coreutils for windows then do this

tr "\r\n" " " < file >newfile

GNU win32 packages | Gawk

Report •

August 21, 2010 at 19:45:08

If you don't have permissions to download you can try the following batch code. Note that the maximum individual environment variable length is stated as 8192 bytes ( so if you want to work with files larger than this an alternative is required, perhaps VBScript.

@echo off
setlocal enabledelayedexpansion

set nbr=0
for /f "tokens=*" %%1 in (input.txt) do (
    if !nbr! lss 1 (
    set line=%%1
      ) else (
    set line=!line! %%1
    set /a nbr+=1
echo %line%>output.txt
type output.txt

Good luck

Report •

August 23, 2010 at 12:46:06

thanks for your help, but i need a DOS tool for a plain MS-DOS :(

Report •

Related Solutions

August 23, 2010 at 15:30:53

Apologies superturrican2, I didn't pick up on your OS, only excuse is the new forum layout LOL!

In prior posts M2G has recommended the utility to remove eol chars but that might not now be relevant. Suggest you post your query on the Disk Op System forum and indicate which version of Dos you are using.

Report •

August 23, 2010 at 17:17:53

really? you are still using the very old MS-DOS 6.22+ ??

GNU win32 packages | Gawk

Report •

August 24, 2010 at 07:56:36

Infact I've post this thread on the DOS forum section... however an Administrator move it here in Batch section :P

I'm doing some work on the old Windows 98, so I need tools for MS-DOS 6/7

Report •

August 24, 2010 at 09:38:48

then you can use the tr tool i mentioned in my post. Its supposed to work on win95 onwards. Pls see the website for more information.

GNU win32 packages | Gawk

Report •

Ask Question