0

I have 3 files created with the following names. Both Header and Trailer contains one record every time.

Input Files :

Header.txt Detail.txt Trailer.txt

I need to copy record from header and insert at the first record of Detail record and also copy record from trailer and insert at the end of Detail record.

Input :

Header.txt

HD

Detail.txt

D1
D2
D3
D4

Trailer.txt

TR

Expected output:

Output.txt

HD
D1
D2
D3
D4
TR

  • 1
    cat Header.txt Detail.txt Trailer.txt – RomanPerekhrest Jul 3 '18 at 10:56
  • welcome to U&L, what have you tried so far ? – Archemar Jul 3 '18 at 11:33
0
cat Header.txt Detail.txt Trailer.txt >Output.txt

This would create the file Output.txt that would be the concatenation of the three files in the order given on the command line (assuming that the output file is able to be created and/or written to).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.