May 21, 2002 #1 pjb Programmer Joined May 1, 2001 Messages 148 Location 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 Joined Apr 8, 2001 Messages 1,294 Location 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 Joined Jun 25, 2002 Messages 18 Location US nl -ba $file | tee $file.fmt Upvote 0 Downvote
Jun 25, 2002 #4 vgersh99 Programmer Joined Jul 27, 2000 Messages 2,146 Location US cat -n ${file} Upvote 0 Downvote