I have a file called header.txt I want this file to be prepended (first line) to all *.txt files in the same directory.
How could I achieve this?
Thanks in advance,
Joe
(SOLVED) Merging files .bat
Moderator: DosItHelp
(SOLVED) Merging files .bat
Last edited by jmituzas on 31 Aug 2010 07:49, edited 1 time in total.
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Merging files .bat
I solved your second question in the previous thread, so I'm not going to write you a solution for this, unless it really is a new question. It's not hard but still a little more complicated, especially if header.txt contains multiple lines.
-
- Posts: 319
- Joined: 12 May 2006 01:13
Re: Merging files .bat
jmituzas wrote:I have a file called header.txt I want this file to be prepended (first line) to all *.txt files in the same directory.
How could I achieve this?
Thanks in advance,
Joe
you can just use the >> redirection operator, the type command.
Code: Select all
type file >> header.txt