Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Unanswered: Append Header Line to All other lines in the file

    Hi,

    I am a shell scripting newbe. I have a CSV file with a HEADER line and data in the file. I have to append the header line to all the other lines in the file.
    How do I do that.

    Thanks in Advance,

    Modem

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    Try awk...

    awk 'NR==1{header=$0}NR!=1{print $0 header}' yourFile > newFile

  3. #3
    Join Date
    Sep 2003
    Posts
    4
    Hi Damian,

    Thank you very much. I worked fine.


    Modem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •