csv
Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 27 April 2025
Index
Return to Main Contents
NAME
csv - filter to process CSV data
SYNOPSIS
edrc/lib/csv
[
-h
]
cat csv_data
|
csv
command
[
options
]
csv
command
[
options
]
< csv_data
---
csv c2s
csv t2s
csv w2s
csv addcol COLNAME [ "column data" ]
csv cat
csv cat:authorized_keys
csv cat:crontab
csv cat:fstab
csv cat:group
csv cat:known_hosts
csv cat:mtab
csv cat:oratab
csv cat:passwd
csv cat:protocols
csv cat:rpc
csv cat:services
csv cat:shadow
csv cat:syscrontab
csv cat:mailcap
csv cat:mailcap:nokey
csv cat:datalist.dat
csv cat:edrcinit.cfg
csv cat:filedist.block
csv cat:fssum.cfg
csv cat:hostlist.dat
csv cat:lgcheckd.cfg
csv cat:logcheckd.cfg
csv cat:name_index
csv cat:osid.dat
csv cat:osid.dat.WA2L
csv cat:pscount.kp
csv cat:role_option.cfg
csv cat:schedule.dat
csv cat:timezone.dat
csv cat:volume.dat
csv cat:list
csv cat:name
csv cat:revision
csv cat:usage
csv cat:avtar
csv cat:mccli
csv comm file
csv comm:both file
csv comm:stdin file
csv comm:file file
csv concat file...
csv count
csv data
csv diff file
csv header
csv head lines
csv join file [ joinfieldnum1 [ joinfieldnum2 ]]
csv list
csv list:nocount
csv list:noemptycols
csv list:noemptycols:nocount
csv list:noemptyrows
csv list:noemptyrows:nocount
csv list:noempty
csv list:noempty:nocount
csv lscol
csv md5 [ COLNAME ]
csv number [ COLNAME ]
csv order "COLNAME1;COLNAME2; ... ;COLNAMEn"
csv outer file [ joinfieldnum1 [ joinfieldnum2 [ unpairablesfilenum ]]]
csv record
csv record:nocount
csv renamecol "OLDCOL1;OLDCOL2; ... ;OLDCOLn"
"NEWCOL1;NEWCOL; ... ;NEWCOLn"
csv row linenumber
csv sed "sed script"
csv sed:silent "sed script"
csv select "COLNAME1;COLNAME2; ... ;COLNAMEn"
csv sort [ sort_options ]
csv tac
csv tail lines
csv timestamp [ COLNAME ]
csv transpose
csv unselect "COLNAME1;COLNAME2; ... ;COLNAMEn"
csv variable [ prefix ]
csv variable:array [ prefix ]
csv variable:number [ prefix ]
csv where "regex"
csv where:ignorecase "regex"
csv wherenot "regex"
csv wherenot:ignorecase "regex"
csv match "wildcard"
csv match:ignorecase "wildcard"
csv matchnot "wildcard"
csv matchnot:ignorecase "wildcard"
AVAILABILITY
WA2L/edrc
DESCRIPTION
filter to process CSV data.
The field separator of the CSV data is a semicolon
(;).
If comma
(,)
separated data needs to be processed, first use
csv c2s,
if tab
separated data needs to be processed, first use
csv t2s
and
if whitespace
separated data needs to be processed, first use the
csv w2s
command to convert the comma separated data to
semicolon separated.
OPTIONS
- -h
-
usage.
- csv command [ options ]
-
command with options to use with the CSV data stream.
Description of available commands, see below.
- csv addcol COLNAME [ "column data" ]
-
add a column with the name
COLNAME
and the given
"column data".
- csv c2s
-
convert comma separations to semicolon separations.
- csv cat
-
clean and join broken CSV lines.
- csv cat:authorized_keys
-
cat data with
'~user/.ssh/authorized_keys'
format as CSV.
- csv cat:fstab
-
cat data with
'/etc/fstab'
format as CSV.
- csv cat:group
-
cat data with
'/etc/group'
format as CSV.
- csv cat:known_hosts
-
cat data with
'~user/.ssh/known_hosts'
format as CSV.
- csv cat:mtab
-
cat data with
'/etc/mtab'
format as CSV.
- csv cat:crontab
-
cat data with user
'/var/spool/cron/(...)/crontab'
format as CSV.
- csv cat:syscrontab
-
cat data with system wide
'/etc/crontab'
format as CSV.
- csv cat:mailcap
-
cat data with
'/etc/mailcap'
format as CSV.
- csv cat:mailcap:nokey
-
cat data with
'/etc/mailcap'
format as CSV
without keys in field data.
- csv cat:oratab
-
cat data with
'oratab'
format as CSV.
- csv cat:passwd
-
cat data with
'/etc/passwd'
format as CSV.
- csv cat:protocols
-
cat data with
'/etc/protocols'
format as CSV.
- csv cat:rpc
-
cat data with
'/etc/rpc'
format as CSV.
- csv cat:services
-
cat data with
'/etc/services'
format as CSV.
- csv cat:shadow
-
cat data with
'/etc/shadow'
format as CSV.
- csv cat:datalist.dat
-
cat data with
'edrc/var/lots/object/datalist.dat'
format as CSV.
- csv cat:edrcinit.cfg
-
cat data with
'edrc/etc/edrcinit.cfg'
format as CSV.
- csv cat:filedist.block
-
cat data with
'edrc/etc/filedist.block'
format as CSV.
- csv cat:fssum.cfg
-
cat data with
'edrc/etc/fssum.cfg'
format as CSV.
- csv cat:hostlist.dat
-
cat data with
'edrc/etc/hostlist.dat'
format as CSV.
- csv cat:lgcheckd.cfg
-
cat data with
'edrc/etc/lgcheckd.cfg'
format as CSV.
- csv cat:logcheckd.cfg
-
cat data with
'edrc/etc/logcheckd.cfg'
format as CSV.
- csv cat:name_index
-
cat data with
'..name_index'
format as CSV.
- csv cat:osid.dat
-
cat data with
'edrc/etc/osid.dat'
format as CSV.
- csv cat:osid.dat.WA2L
-
cat data with
'edrc/etc/osid.dat.WA2L'
format as CSV.
- csv cat:pscount.kp
-
cat data with
'edrc/var/pscount/*/<app>.kp'
format as CSV.
- csv cat:role_option.cfg
-
cat data with
'edrc/etc/role_option.cfg'
format as CSV.
- csv cat:schedule.dat
-
cat data with
'edrc/var/lots/object/schedule.dat'
format as CSV.
- csv cat:timezone.dat
-
cat data with
'edrc/etc/timezone.dat'
format as CSV.
- csv cat:volume.dat
-
cat data with
'edrc/var/lots/object/volume.dat'
format as CSV.
- csv cat:list
-
cat data with
csv list
command output format as CSV.
- csv cat:name
-
cat data with
name(1)
command output format as CSV.
- csv cat:revision
-
cat data with
revision(1)
command output format as CSV.
- csv cat:usage
-
cat data with
usage(1)
command output format as CSV.
- csv cat:avtar
-
cat data with
Avamar
avtar
command output format as CSV.
- csv cat:mccli
-
cat data with
Avamar
mccli
command output format as CSV.
- csv comm file
-
compare
stdin
with a
file,
rows common to both
(stdin
and
file).
The data from
stdin
and the
file,
is sorted by the
csv comm
command prior to comparing it.
- csv comm:both file
-
compare
stdin
with a
file,
rows common to both
(stdin
and
file).
The data from
stdin
and the
file,
is sorted by the
csv comm:both
command prior to comparing it.
- csv comm:stdin file
-
compare
stdin
with a
file,
rows unique to
stdin.
The data from
stdin
and the
file,
is sorted by the
csv comm:stdin
command prior to comparing it.
- csv comm:file file
-
compare
stdin
with a
file,
rows unique to
file.
The data from
stdin
and the
file,
is sorted by the
csv comm:file
command prior to comparing it.
- csv concat file...
-
concatenate
stdin
with a space separated list of
files.
- csv count
-
count number of data rows.
- csv diff file
-
compare
stdin
with a
file.
The data from
stdin
and the
file,
is sorted by the
csv diff
command prior to comparing it.
The file indicators
<,
>
and
=
as known from the
diff(1)
command on normal files,
are shown in an additional column with the name
DIFF.
- csv data
-
print CSV data.
- csv head lines
-
print
lines
lines from the beginning of CSV data.
- csv header
-
print CSV header.
- csv join file [ joinfieldnum1 [ joinfieldnum2 ]]
-
join
stdin
with a file.
- csv list
-
print data as formatted list.
- csv list:nocount
-
print data as formatted list without output of the count line.
- csv list:noemptycols
-
print data as formatted list but do not list columns that have no
data (which are empty).
- csv list:noemptycols:nocount
-
print data as formatted list but do not list columns that have no
data (which are empty) without output of the count line.
- csv list:noemptyrows
-
print data as formatted list but do not list rows that have no
data (which are empty).
- csv list:noemptyrows:nocount
-
print data as formatted list but do not list rows that have no
data (which are empty) without output of the count line.
- csv list:noempty
-
print data as formatted list but do not list rows and columns
that have no data (which are empty).
- csv list:noempty:nocount
-
print data as formatted list but do not list rows and columns
that have no data (which are empty) without output of the count
line.
- csv lscol
-
list columns of CSV header as numbered list.
- csv md5 [ COLNAME ]
-
add a md5 checksum column and optionally name the
MD5
column with
COLNAME.
- csv number [ COLNAME ]
-
number rows and optionally name the
NR
column with
COLNAME.
- csv order "COLNAME1;COLNAME2; ... ;COLNAMEn"
-
change order of columns.
- csv outer file [ joinfieldnum1 [ joinfieldnum2 [ unpairablesfilenum ]]]
-
join
stdin
with a file including unpairable lines.
- csv record
-
print CSV line as record.
- csv record:nocount
-
print CSV line as record without output of the count line.
- csv renamecol "OLDCOL1;OLDCOL2; ... ;OLDCOLn" "NEWCOL1;NEWCOL2; ... ;NEWCOLn"
-
rename columns.
- csv row linenumber
-
print data of record with
linenumber
from the CSV data.
- csv sed "sed script"
-
stream editor
(sed)
for csv data.
- csv sed:silent "sed script"
-
stream editor
(sed)
for csv data without automatic printing of pattern space (equals to
sed -n "sed script").
- csv select "COLNAME1;COLNAME2; ... ;COLNAMEn"
-
select columns.
- csv sort [ sort_options ]
-
sort data.
- csv tac
-
print CSV data in reverse.
- csv tail lines
-
print
lines
lines from the end of CSV data.
- csv timestamp [ COLNAME ]
-
add a timestamp column in the military format
YYYY-MM-DD HH:MM:SS
and optionally name the
TIMESTAMP
column with
COLNAME.
- csv transpose
-
transpose the CSV file.
- csv t2s
-
convert tabulator separations to semicolon separations.
- csv unselect "COLNAME1;COLNAME2; ... ;COLNAMEn"
-
de-select columns.
- csv variable [ prefix ]
-
print CSV line as initialize-able variables
COLNAME="field"
or
prefixCOLNAME="field".
- csv variable:array [ prefix ]
-
print CSV line as initialize-able numbered variables
COLNAME[#]="field"
or
prefixCOLNAME[#]="field".
- csv variable:number [ prefix ]
-
print CSV line as initialize-able variables array
COLNAME_#="field"
or
prefixCOLNAME_#="field".
- csv where "regex"
-
select data with a regular expression.
- csv where:ignorecase "regex"
-
select data non case sensitive with a regular expression.
- csv wherenot "regex"
-
inverse data select with a regular expression.
- csv wherenot:ignorecase "regex"
-
inverse data select non case sensitive with a regular expression.
- csv match "wildcard"
-
select data with a wildcard expression.
- csv match:ignorecase "wildcard"
-
select data non case sensitive with a wildcard expression.
- csv matchnot "wildcard"
-
inverse data select with a wildcard expression.
- csv matchnot:ignorecase "wildcard"
-
inverse data select non case sensitive with a wildcard expression.
- csv w2s
-
convert whitespace separations to semicolon separations.
ENVIRONMENT
- $TMPDIR
-
temporary base directory
(default=/tmp/)
needed to sort data.
If file space shortages are observed set this variable
to a location with sufficient space.
EXIT STATUS
- 0
-
no error.
- 1
-
error.
- 4
-
usage displayed.
FILES
-
EXAMPLES
-
SEE ALSO
edrcintro(1),
authorized_keys(8),
comm(1),
csvcat(3),
csvq(3),
csv2worksheet(3),
crontab(1),
crontab(5),
diff(1),
egrep(1),
fit(3),
fit2width(3),
fnmatch(3),
fstab(5),
getmntent(3),
group(5),
head(1),
indent(3),
join(1),
jq(3),
mailcap(5),
name(1),
passwd(5),
print_list(3),
print_header(3),
print_index(3),
protocols(5),
revision(1),
sed(1),
select_columns(3),
services(5),
shadow(5),
sort(1),
tac(1),
tail(1),
usage(1),
xml2json(1)
NOTES
-
BUGS
-
AUTHOR
csv was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
COPYRIGHT
Copyright © 2023
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.
This document was created by man2html
using the manual pages.
Time: 16:33:46 GMT, April 30, 2025