I need to print the contents of a file and give a header to each column, leaving enough space for reading, and then I need to output it to a new file. I watched this tutorial closely, but I was stuck.
http://www.thegeekstuff.com/2010/01/awk-introduction-tutorial-7-awk-print-examples
This is an example of the code they use, which will give me exactly what I need to do with mine. But that will not work when I adjust it.
$ awk 'BEGIN {print "Name\tDesignation\tDepartment\tSalary";}
{print $2,"\t",$3,"\t",$4,"\t",$NF;}
END{print "Report Generated\n--------------";
}' employee.txt
This is mine, because unlike the example, I want the whole document to be printed and really do not want this “generated report” to be meaningless. I tried to add {print;} "to the end after this, and was sure to run a new line and ... nothing.
$ awk 'BEGIN {Print "Firstname\tLastname\tPoints";} END > awktest.txt > done
Where am I wrong? He continues to give me the response line of the source.