pucko73
asked on
help with cmd/bat file
Hello.
I have a directory with some text files I like to merge
that can be done by copy c:\myfolder\*.txt destfile.txt
But what I need to do is to have the files in a specific order (ie only a few of them is important)
So what I want to do is having a file fileorder.txt (not in the same folder)
that contains the files that should be first in that order
so the cmd file shoud read the fileorder.txt
and merge all the files that are in there into destfile.txt
then all the other files that are not in fileorder.txt should be appended after
those files.
How can i do that?
I have a directory with some text files I like to merge
that can be done by copy c:\myfolder\*.txt destfile.txt
But what I need to do is to have the files in a specific order (ie only a few of them is important)
So what I want to do is having a file fileorder.txt (not in the same folder)
that contains the files that should be first in that order
so the cmd file shoud read the fileorder.txt
and merge all the files that are in there into destfile.txt
then all the other files that are not in fileorder.txt should be appended after
those files.
How can i do that?
ASKER
Seems like it dont work for me.
I have this:
c:\fileorder.txt containing
b.txt
c.txt
in c:\myfolder i have 4 files. a.txt b.txt c.txt d.txt
The DestFile.txt ends up with som strange charaters and only the content of b.txt joined with c.txt.
I have this:
c:\fileorder.txt containing
b.txt
c.txt
in c:\myfolder i have 4 files. a.txt b.txt c.txt d.txt
The DestFile.txt ends up with som strange charaters and only the content of b.txt joined with c.txt.
ASKER
IE the file contains :
Row 1 : content of b.txt
Row 2. Character for ascii value 26 and the content of c.txt
Row 3. 3 times the chaqracter for ascii value 26
Row 1 : content of b.txt
Row 2. Character for ascii value 26 and the content of c.txt
Row 3. 3 times the chaqracter for ascii value 26
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works like a charm.
Thanks. !
Thanks. !
Open in new window