43.9 Indenting Text for PrintingIf you want to print a file that has plain text (not PostScript or some other page description language), you can indent the printout by adding some spaces to the start of each line. Use sed ( 34.24 ) to add a TAB or two (if your printer can handle TABs) - otherwise, spaces - to the start of each line. Here's a simple command that adds four spaces to the start of each line of the logdata file, then prints with lpr :
% You'll run into trouble if the file you're printing has any TABs in it though, because the extra spaces at the start of each line can mess up the tabstops. In that case, expand tabs ( 41.4 ) first:
% The pr ( 43.7 ) command makes a nicely formatted printout. You can indent its output, too. If your pr doesn't have a -o (offset) switch, though, pipe its output through sed :
% That doesn't always work. If there are TABs in the file, pr may not expand them - though some versions of pr have a -e switch to do that. Also, your indentation will indent the heading on each page - too much indentation can shove the heading off the right-hand side of the paper. Here's a better command to handle those problems. It expands the TABs and indents the body but doesn't indent the heading:
%
The The offset ( 35.7 ) script lets you set the indentation with a command-line option. - |
|