kwasserman
Technical User
I need to insert a page break (“\f”) in front of the first header line of a report, like this:
“\f”LP240 Date 06/21/10
I’m using the following awk code:
awk '{sub("LP240","\fLP240");print}' inputfile > outputfile
This works and inserts the page break, but I only want to do this for the first header line. If there is more than one page in the report then there will already be a page break for the next page header, and the awk code inserts a second page break, which will cause an extra blank page to print in the middle of the report. I only want to insert the page break for the header on the first page, and not touch any other header lines for subsequent pages.
“\f”LP240 Date 06/21/10
I’m using the following awk code:
awk '{sub("LP240","\fLP240");print}' inputfile > outputfile
This works and inserts the page break, but I only want to do this for the first header line. If there is more than one page in the report then there will already be a page break for the next page header, and the awk code inserts a second page break, which will cause an extra blank page to print in the middle of the report. I only want to insert the page break for the header on the first page, and not touch any other header lines for subsequent pages.