Remove EOF (0x1A) from the file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Remove EOF (0x1A) from the file

#1 Post by miskox » 12 Feb 2014 13:36

Hi all,

if I

Code: Select all

copy file1.txt+file2.txt file3.txt


copy command always adds an EOF character (0x1A aka SUB).

Is there an easy way to remove it?

Thank you.
Saso

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Remove EOF (0x1A) from the file

#2 Post by carlos » 12 Feb 2014 13:48

Use /b for each file:

Code: Select all

copy file1.txt /b + file2.txt /b file3.txt /b

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Remove EOF (0x1A) from the file

#3 Post by dbenham » 13 Feb 2014 10:42

carlos wrote:Use /b for each file:

Code: Select all

copy file1.txt /b + file2.txt /b file3.txt /b
That will preserve any existing EOF that may exist in your source files, which could be a bad thing.

It may be better to use /A for the source, and /B for the target.

Code: Select all

copy /a file1.txt + file2.txt file3.txt /b


Dave Benham

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Remove EOF (0x1A) from the file

#4 Post by miskox » 14 Feb 2014 10:47

Thank you very much both for you suggestions. This solves my problem.

Saso

Post Reply