print_record

Package: WA2L/WinTools 1.2.09
Section: Library Commands (3)
Updated: 09 February 2026
Index Return to Main Contents

 

NAME

print_record - print CSV line as record

 

SYNOPSIS

WA2LWinTools/lib/[shell/]print_record [ -h | -V ]

print_record [ "field_separator" ]

 

AVAILABILITY

WA2L/WinTools

 

DESCRIPTION

the intention of this command is to print CSV data as records. A CSV data provided via pipe from stdin is formatted and printed to stdout.

The first row is treated as header row.

White spaces adjacent to the field separators are trimmed, empty lines and # - commented lines are ignored.

To select named columns from the CSV data prior to the formatting of the list with print_record use select_columns(3).

 

OPTIONS

-h
usage message.

"field_separator"
field separator. If not specified, the default field separator is the semicolon (;).

If the first line is sep=S as seen as result of some spreadsheet exported CSV files, the field separator S is used.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

4
usage displayed.

5
version displayed.

 

FILES

-

 

EXAMPLES

1) print CSV data as record

The following CSV data received via pipe

  type cities.csv

  ZIP;CITY;STATE;CNT;COUNTRY
  93117;Goleta;CA;USA;United States of America
  8222;Beringen;SH;CH;Switzerland
  8005;Cape Town;WC;RSA;South Africa

  type cities.csv | print_record

results in the output:

      ZIP  93117
     CITY  Goleta
    STATE  CA
      CNT  USA
  COUNTRY  United States of America
 
      ZIP  8222
     CITY  Beringen
    STATE  SH
      CNT  CH
  COUNTRY  Switzerland
 
      ZIP  8005
     CITY  Cape Town
    STATE  WC
      CNT  RSA
  COUNTRY  South Africa
 
  (3)

2) print selected columns of CSV data as records

The columns CNT, ZIP and CITY of the CSV data are selected using the select_columns(3) command and then formatted to a list using the print_list command

  type cities.csv

  ZIP;CITY;STATE;CNT;COUNTRY
  93117;Goleta;CA;USA;United States of America
  8222;Beringen;SH;CH;Switzerland
  8005;Cape Town;WC;RSA;South Africa

  type cities.csv | select_columns ";" "CNT;ZIP;CITY" | print_record


what will result in the output:


   CNT  USA
   ZIP  93117
  CITY  Goleta
 
   CNT  CH
   ZIP  8222
  CITY  Beringen
 
   CNT  RSA
   ZIP  8005
  CITY  Cape Town
 
  (3)

 

SEE ALSO

wintoolsintro(1), csvgrep(3), epoch2local(3), epoch2utc(3), indent(3), lscol(1), print_header(3), print_index(3), print_list(3), print_sample(3), select_columns(3)

 

NOTES

-

 

BUGS

-

 

AUTHOR

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

 

COPYRIGHT

Copyright © 2026 Christian Walther

This is free software; see WA2LWinTools/man/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: 20:59:27 GMT, February 16, 2026