Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
A batch file I am working on copys 5 files together.
Files 1,3,5 are files I have created and copy perfectly.(if copied 1,3,5 are on the same line)Files 2 and 4 are created by the computer and have End of line tags on them. So when the file are put together it comes out as
1,2
3,4
5Instead of 1,2,3,4,5.
Any help in locating a eof tag remover or some code to get it off would be appreciated. The info in the two computer generated files changes every second or so ,so doing a fix manually wont do.
File 2 is a copy of the zip file using dir /B > two.dat
File 4 is a copy of the program name extracted from the file id and placed into
four.datThe three contants are just html snipits and do not change.
Hope some one here is into batch files and can help.
Well thank you for any consideration you might give to this request for help.
Robin

Hi,
As I understand you are copying all those files in one file with + sign. Try to use /B switch in the copy command. With that switch all files considered binary files and EOF characters would be ignored.
Good luck, Igor M

Hi,
For some reason my computer ignores the /b switch. It might be the batch itself. It is a bit long, and complex. I am thinking that the /b switch is either ignored or in conflict with some thing else.I did get hold of a program that has soved the problem though.
I have been working on this bat for almost three months and it is just a few lines away from being finished..........I have no idea what I will do then...........
I hate it when that happens......LOL
Well I do thank you for responding.:-)
Robin aka ......World Library

The /b is probably not what you are looking for. As I understand you problem, you copy a group of files. Then some program tries to read the files from a single file containg what was once 5 separate files and it runs into a premature end of file mark.
The bad news is that I don't think that there is any way to strip off the extra end of file marks using statements in a .BAT file.
Have you thought of creating a program in whatever language you use that will make a new copy of the offending files that does not contain an end of file mark?
I don't really understand why the end of file mark gets copied. Every file has and end of file mark. When files are combined using COPY and +, the end of file mark should be used by COPY to determine when to end the copy of that file. Then when all 5 files have been copied, DOS will indicate end of file after the last file copied.
And when you go to read the combined file that you describe, how do you get past the end of file mark that you say follows file 2 on the combined file?
And why is the end of file mark at the end of files 2 and 4 different?
I thought that I was going to be of some help here, but I've ended up creating questions instead!

Also, I saw some indication that the size of the .BAT file might be a cause for concern. I have a .BAT file that is 30k long and very complex. The only time that I have trouble with it is when I make a stupid mistake. I don't think that the size of a .BAT file is of concern.
The other size concern might be the size of a statement in a .BAT file. It's limited to 127 characters until you use DOS under WindowsNT. When working with the 127 byte restriction, use a cascading copy:
COPY A + B + C X1
COPY X1 + D + E + F X2
COPY X2 + G + H FULLFILE

![]() |
Copy help
|
Batch files
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |