sandeep k.c Gowda
sandeep k.c Gowda

Reputation: 27

Batch file to copy content of one txt file into another text file

I have two text files:

  1. header file header.text has text:
*===================================================
*          HEADER     : bulk                            
*===================================================
* New|New|ON|CRM|Pre
*===================================================
  1. body file body.text has text:
0999|Siebel|Customer5|12345|SA|Cash|test|||||||0|

Need to copy the header file text to body file text and after copying it should look like below:

*===================================================
*          HEADER     : bulk                            
*===================================================
* New|New|ON|CRM|Pre
*===================================================
0999|Siebel|Customer5|12345|SA|Cash|test|||||||0|

Need batch script to implement this.

Upvotes: 0

Views: 2974

Answers (2)

Stephan
Stephan

Reputation: 56180

just append...

type body.text>>header.text

Upvotes: 1

dazedandconfused
dazedandconfused

Reputation: 3186

You can append two files using the '+' operator like so...

copy /b header.txt + body.txt destfile.txt

Upvotes: 1

Related Questions