ViewVC logotype

Contents of /csv2latex.1

Parent Directory Parent Directory | Revision Log Revision Log

Revision 7 - (show annotations)
Sat Feb 6 19:21:52 2010 UTC (10 years, 7 months ago) by ben
File size: 7080 byte(s)
updated manpage
1 .TH "CSV2LATEX" "1"
2 .SH "NAME"
3 csv2latex \(em convert a csv file into a LaTeX document
5 .PP
6 \fBcsv2latex\fR [\fB\-\-nohead\fP] [\fB\-\-longtable\fP] [\fB\-\-noescape\fP] [\fB\-\-guess\fP] [\fB\-\-separator \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP] [\fB\-\-block \fIq\fR|\fId\fR|\fIn\fR\fP] [\fB\-\-lines \fI#\fR\fP] [\fB\-\-position \fIl\fR|\fIc\fR|\fIr\fR\fP] [\fB\-\-colorrows \fI0-1\fR\fP] [\fB\-\-reduce \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP] [\fB\-\-repeatheader\fP] [\fB\-\-nohlines\fP] [\fB\-\-novlines\fP] [file]
8 .PP
9 This manual page documents the \fBcsv2latex\fR program.
10 .PP
11 \fBcsv2latex\fR is a program that reads a "comma separated values" (csv) file
12 and outputs a LaTeX file with one or more tabular environments to display
13 the printable values of the csv file. The LaTeX code is flushed on the standard output.
15 .PP
16 So-called "comma separated values" files are common formats for exchanging two-dimensinal
17 tables between programs such as spreadsheets editors, to represent almost any kind of data.
18 By default, a csv file is made of printable data separated by commas (`,'), each comma
19 representing a `cell' separator, and each line representing a row. By extension, cell
20 separators can be represented by tabs if the comma is considered as printable data.
21 Moreover, some non true csv files can be assumed as two-dimensional tables as well.
22 In some circumstances, if the printable data includes the cell separator of the
23 exchange format, the latter can use a second extra character to embrace the printable
24 data into a block (e.g: quoted text). Thus, it is still possible to parse the file by
25 using the block delimiter (used twice to embrace the cell) instead of the separator.
27 .PP
28 \fBcsv2latex\fR aims to parse various csv formats plus formats that fits
29 into the above definiton, assuming the data is text, and to produce a yet simple LaTeX file
30 using the "tabular" environment for a table-style layout.
31 Some options of output will also use macros provided by extra
32 LaTeX packages that are commonly included in the main LaTeX distributions.
35 .PP
36 This program follows the usual GNU command line syntax,
37 with long options starting with two dashes (`\-'). A summary of
38 options is included below.
39 .IP "\fB-h\fP \fB\-\-help\fP " 10
40 Show summary of options.
41 .IP "\fB-v\fP \fB\-\-version\fP " 10
42 Show version of program.
43 .IP "\fB-n\fP \fB\-\-nohead\fP " 10
44 Do not output the LaTeX document header.
45 This is useful when the output is to be included as a separate file into the master document.
47 .IP "\fB-t\fP \fB\-\-longtable\fP " 10
48 uses the 'longtable' package instead of the 'tabular' one.
49 This is useful when the input is long, with \fB\-\-lines 0\fP option.
50 This option uses the extra `longtable' LaTeX package.
51 If you also use \fB\-\-nohead\fP option, do not forget to add
52 the following line into the header of your master document: "\\usepackage{longtable}".
54 .IP "\fB-x\fP \fB\-\-noescape\fP " 10
55 Do not escape TeX control characters from the input.
56 This is useful when the input contains already TeX code.
58 .IP "\fB-g\fP \fB\-\-guess\fP " 10
59 Try to guess the csv format.
60 This is useful when the input is not strictly a comma separated set of printable data.
61 For example, a line like %Foo, Bar%:%Wizz: Hey% may be parsed as "Foo, Bar" then "Wizz: Hey".
63 .IP "\fB-s \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP \fB\-\-separator \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP " 10
64 Set the given separator as cell separator of the csv format.
65 `c' means a comma (default).
66 `s' means a semicolon.
67 `t' means a tab.
68 `p' means a space.
69 `l' means a colon.
71 .IP "\fB-b \fIq\fR|\fId\fR|\fIn\fR\fP \fB\-\-block \fIq\fR|\fId\fR|\fIn\fR\fP " 10
72 Set the given block delimiter that embraces the printable data of the csv format.
73 `q' means a simple quote.
74 `d' means a double quote.
75 `n' means no quoting at all (default).
77 .IP "\fB-l \fI#\fR\fP \fB\-\-lines \fI#\fR\fP " 10
78 Force to output multiple tabulars, each having a limited number of lines.
79 The given argument must be a POSITIVE INTEGER VALUE. This is useful when
80 the number of input rows is too big to fit into a single papersheet.
81 A good average for a4 paper is about 40 lines (default). 0 means infinity
82 (actualy about 2 Giga lines).
84 .IP "\fB-p \fIl\fR|\fIc\fR|\fIr\fR\fP \fB\-\-position \fIl\fR|\fIc\fR|\fIr\fR\fP " 10
85 Set the text position in all cells at once.
86 This simply uses one of the three basic cell formating options of the LaTeX tabular environment.
87 `l' means left-aligned (default).
88 `c' means centered.
89 `r' means right-aligned.
91 .IP "\fB-c \fI0-1\fR\fP \fB\-\-colorrows \fI0-1\fR\fP " 10
92 Alternate white/gray rows on the LaTeX output, having the given graylevel.
93 The given argument must be a REAL NUMBER BETWEEN 0 AND 1.
94 0 means black while 1 means white.
95 A nice looking value is 0.75 when printed on white paper.
96 This option uses the extra `colortbl' LaTeX package.
97 If you also use \fB\-\-nohead\fP option, do not forget to add
98 the following line into the header of your master document: "\\usepackage{colortbl}".
100 .IP "\fB-r \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP \fB\-\-reduce \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP " 10
101 Reduce the size of the tabular and the font in the LaTeX output, given a reduction level.
102 The given argument must be one of 1, 2, 3 or 4.
103 The more the level is high, the more the tabular will appear small.
104 This is useful to shrink the table width when the printable data is made of very long text.
105 This option uses the extra `relsize' LaTeX package.
106 If you also use \fB\-\-nohead\fP option, do not forget to add
107 the following line into the header of your master document: "\\usepackage{relsize}".
109 .IP "\fB-z\fP \fB\-\-nohlines\fP " 10
110 Do not output horizontal lines in the table(s).
112 .IP "\fB-y\fP \fB\-\-novlines\fP " 10
113 Do not output vertical lines in the table(s).
115 .IP "\fB-e\fP \fB\-\-repeatheader\fP " 10
116 Repeat the first row of the first table in every table.
117 This is useful when the output is very long and separated in
118 multiple tables.
121 .PP
122 Create a PDF document with small text, alternate gray rows, 80 lines per table,
123 from a guessed csv format of the january stats that my boss created with his
124 super point-and-click spreadsheet program (which could not generate a PDF output!).
126 .PP
127 \fBcsv2latex \-\-guess \-\-lines 80 \-\-colorrows 0.75 \-\-reduce 2 january_stats.csv > january_stats.tex && pdflatex january_stats.tex\fR
128 .PP
129 Quickly preview a phonebook from a file formated as "Surname" "Name" "Phone" "Cellular":
131 .PP
132 \fBcsv2latex \-s p \-b d \-l 42 phonebook-sorted.txt | latex\fR
133 .SH "SEE ALSO"
134 .PP
135 tex (1), latex (1).
136 .\" created by instant / docbook-to-man, Sat 06 Feb 2010, 20:20

  ViewVC Help
Powered by ViewVC 1.1.26