Page 1 of 1

remove a square

Posted: 23 May 2008 08:03
by burton1986
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.

Re: remove a square

Posted: 29 May 2008 20:32
by chcfrank
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.

Posted: 04 Jun 2008 07:57
by burton1986
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.

Posted: 16 Jun 2008 15:43
by drgnfyre
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.