remove a square

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
burton1986
Posts: 2
Joined: 23 May 2008 06:48

remove a square

#1 Post by burton1986 » 23 May 2008 08:03

Hi All,

I'm new to dos batch files and am only using to append files together. My problem is probably very simple to fix but I have no idea. I have tried for the past few days to find an answer but to no avail.

I have three files in a folder which I need to append together. I do this by using the below.

copy Z:\Files\Terminated\*.* Z:\filesoutput\Daily_File_Terminated.txt

The problem with this is it adds a square to the end of the footer. Is there a simple way to remove this square without manually doing this as this file will be generated each day.

I only need to delete the square.

chcfrank
Posts: 10
Joined: 22 May 2008 20:24

Re: remove a square

#2 Post by chcfrank » 29 May 2008 20:32

Not sure what you mean by 'square'. Is it a special character look like a square?

Your copy command should not append anything extra. Have you check the file size of the result is the sum of the size of the three source files?

-Frank

burton1986 wrote:Hi All,

I'm new to dos batch files and am only using to append files together. My problem is probably very simple to fix but I have no idea. I have tried for the past few days to find an answer but to no avail.

I have three files in a folder which I need to append together. I do this by using the below.

copy Z:\Files\Terminated\*.* Z:\filesoutput\Daily_File_Terminated.txt

The problem with this is it adds a square to the end of the footer. Is there a simple way to remove this square without manually doing this as this file will be generated each day.

I only need to delete the square.

burton1986
Posts: 2
Joined: 23 May 2008 06:48

#3 Post by burton1986 » 04 Jun 2008 07:57

Yes it is a special character that looks like a square.

I have checked the file size and this is only showing as 1kb. The files are 1kb each.

drgnfyre
Posts: 2
Joined: 16 Jun 2008 15:38

#4 Post by drgnfyre » 16 Jun 2008 15:43

I have ran into this. You simply need to tell copy to copy the file in "binary" mode. (use /b)

copy a.txt +b.txt +c.txt final.txt /b

The square is the End of File indicator or something similar that gets copied when it uses ASCII mode.

Post Reply