summaryrefslogtreecommitdiffstats
path: root/tcllib/examples/csv/README
blob: 979822027f2e5af8e9d11fd82156905342139917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Here are some applications for handling and manipulating CSV files in
various ways. Provided are:
=======================================================================

csv2html ?-sep sepchar? ?-title string? file...

	Reads CSV data from the files and returns it as a HTML table
	on stdout.

=======================================================================

csvsort ?-sep sepchar? ?-f? ?-n? ?-r? ?-skip cnt? column file.in|- file.out|-

	Like "sort", but for CSV files. Sorts after the specified
	column. Input and output are from and to a file or stdin
	and stdout (Any combination is possible).

	Options:

	-sep	specifies the separator character used in the input file.
		Default is comma.

	-n	If specified integer sorting is used.
	-f	If specified floating point sorting is used.
		(-n and -f exclude each other. If both are used the
		last option decides the mode).

	-r	If specified reverse sorting is used (largest first)

	-skip	If specified that number of rows is skipped at the beginning,
		i.e. excluded from sorting. This is to allow sorting of
		CSV files with header lines.

=======================================================================

csvcut  ?-sep sepchar? LIST file...

	Like "cut", but for CSV files. Print selected parts of CSV
	records from each FILE to standard output.

	LIST is a comma separated list of column specifications. The
	allowed forms are:

	N	numeric specification of single column
	N-M	range specification, both parts numberic,
		N < M required.
	-M	See N-M, N defaults to 0.
	N-	See N-M, M defaults to last column

	If there are no files or file = "-" read from stdin.

=======================================================================

csvuniq ?-sep sepchar? column file.in|- file.out|-

	Like "uniq", but for CSV files. Uniq's the specified column.
	Writes the first record it encounters for a value. Input and
	output are from and to a file or stdin and stdout (Any
	combination is possible).

	Options:

	-sep	specifies the separator character used in the input file.
		Default is comma.

=======================================================================

csvjoin ?-sep sepchar? ?-outer? keycol1 file1.in keycol2 file2.in file.out|-

	Joins the two CSV inputtables using the specified columns as
	keys to compare and associate. The result will contain all
	columns from both files with the exception of the second key
	column (the result needs only one key column, the other is
	identical by definition and therefore superfluous).

	Options:

	-sep	specifies the separator character used in the input file.
		Default is comma.

	-outer	Flag, perform outer join. Means that if the key is
		missing in file2 a record is nevertheless written,
		extended with empty values.

=======================================================================