print_index

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 10 February 2024
Index Return to Main Contents

 

NAME

print_index - print a standard column index

 

SYNOPSIS

edrc/lib/print_index [ -h ]

print_index [ "field separator" [ indent [ columns [ fixwidth [ nospace ]]]]]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

print a standard report column index to the terminal.

The output is limited to the current terminal width if the environment variable $PRINT_FIT2WIDTH is not set to False.

 

OPTIONS

-h
usage message.

"field separator"
field separator of the input data given via stdin. If not specified, the field separator defaults to the semicolon ( ; ).

indent
left indent of the output in characters. If not specified the output is not indented.

columns
number of columns of the column index output. If not specified a default of 2 applies.

fixwidth
set to False for dynamic description column with, else (True) all columns have the identical width.

nospace
set to True to eliminate tailing spaces at index lines, else (False) all lines have the identical width filled with tailing spaces.

 

ENVIRONMENT

$PRINT_FIT2WIDTH
If this environment variable is not set to False , the output is limited to the current width of the terminal window and rows extending the window width are marked with '>>'.

 

EXIT STATUS

0
no error.

4
usage displayed.

 

FILES

-

 

EXAMPLES

1) print a column index to the terminal

This report is intended to be viewed on the terminal. All lines extending the terminal window width will be cut an marked with '>>' to show that there is hidden information.

  #!/bin/sh
  :  
  :  
  cat<<EOM | print_index
  ZIP;Postal Zip Code
  CITY;Name of the City
  STATE;State
  CNT;Country Shortcut
  COUNTRY; Country Full Name
  EOM
  :
  :

Result of this script when the terminal window width is smaller then the output width:


COLUMN INDEX:

  ZIP .............. Postal Zip Code       CNT ...... >>
  CITY ............. Name of the City      COUNTRY .. >>
  STATE ............ State

2) print a column index to be saved to a file

This report is intended to be saved to a file. This is why the environment variable $PRINT_FIT2WIDTH is set to False in this example.

  #!/bin/sh
  :
  :
  PRINT_FIT2WIDTH=False; export PRINT_FIT2WIDTH

  cat<<EOM | print_index
  ZIP;Postal Zip Code
  CITY;Name of the City
  STATE;State
  CNT;Country Shortcut
  COUNTRY; Country Full Name
  EOM
  :
  :

 

SEE ALSO

edrcintro(1), print_header(3), print_list(3), select_columns(3)

 

NOTES

The four commands print_index(3), select_columns(3), print_index(3) and print_index(3) provide the functionality to efficiently produce ASCII reports having an identical look.

 

BUGS

-

 

AUTHOR

print_index was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2009 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:14:19 GMT, March 08, 2025