May 21, 2002 #1 pjb Programmer May 1, 2001 148 US I need to put line numbers on a file in the first 8 positions. What is a good way?
May 21, 2002 #2 CaKiwi Programmer Apr 8, 2001 1,294 US One way is to use awk Code: awk '{printf("%8d %s\n",NR,$0)}' infile > outfile Hope this helps. CaKiwi Upvote 0 Downvote
One way is to use awk Code: awk '{printf("%8d %s\n",NR,$0)}' infile > outfile Hope this helps. CaKiwi
Jun 25, 2002 #3 quirkasaurus Programmer Jun 25, 2002 18 US nl -ba $file | tee $file.fmt Upvote 0 Downvote