Thursday, December 21, 2006

Reading log files

Sometimes SAS error log would show the line number. Simple text editors like pico and text readers such as less or more do not show the line number.
We can use nl (number line) command in such situation. If the file is big, to make the file the readable through scrolling, pipe can be used.
This would be the output.

The default behavior of nl is to skip blank lines, as shown above. The treatment of blank lines can be modified with the -b switch. Some -b options are -ba (number all lines), -bt (number only text lines -- the default behavior)