Skip to content

Commit

Permalink
2.03
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-huet committed Aug 25, 2016
1 parent 1bf6382 commit 4bc6e67
Show file tree
Hide file tree
Showing 11 changed files with 1,231 additions and 708 deletions.
4 changes: 2 additions & 2 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Metadata-Version: 1.0
Name: csv2odf
Version: 2.02
Version: 2.03
Summary: Convert csv files to open document format
Home-page: http://csv2odf.sourceforge.net
Author: Larry Jordan
Author-email: w322 at users.sourceforge.net
Author-email: w322@users.sourceforge.net
License: GNU GPL-3
Description: Convert a csv file to odf, ods, html, xlsx, or docx format. csv2odf is a command line tool that can convert a comma separated value (csv) file to an odf, ods, html, xlsx, or docx document that can be viewed in LibreOffice and other office productivity programs. csv2odf is useful for creating reports from databases and other data sources that produce csv files. csv2odf can be combined with cron and shell scripts to automatically generate business reports. . The output format (fonts, number formatting, etc.) is controlled by a template file that you design in LibreOffice. . csv2odf is written in Python.
Platform: any
1,660 changes: 1,082 additions & 578 deletions csv2odf

Large diffs are not rendered by default.

Binary file modified debian/changelog.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: csv2odf
Version: 2.02
Version: 2.03
Homepage: http://csv2odf.sourceforge.net/
Architecture: all
Installed-Size: 160
Installed-Size: 176
Maintainer: Larry Jordan <w322@users.sourceforge.net>
Depends: python (>= 2.6)
Suggests: libreoffice
Expand Down
7 changes: 7 additions & 0 deletions doc/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
csv2odf (2.03) unstable; urgency=low

* Added -a option to append to existing data.
* Fixed problem with large files on Windows.

-- Larry Jordan <w322@users.sourceforge.net> Mon, 20 Apr 2015 09:33:40 -0400

csv2odf (2.02) unstable; urgency=low

* Fixed pipes in Windows when using python 2.7.
Expand Down
2 changes: 1 addition & 1 deletion doc/copyright
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
This package was debianized by the author Larry Jordan <w322 at users.sourceforge.net>

csv2odf is copyrighted (c) 2014 by Larry Jordan <w322 at users.sourceforge.net>
csv2odf is copyrighted (c) 2015 by Larry Jordan <w322 at users.sourceforge.net>

License:

Expand Down
19 changes: 11 additions & 8 deletions doc/csv2odf.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ csv2odf [\fIoption\fP] [<\fIcsvfile\fP>] <\fItemplatefile\fP> [<\fIoutputfile\fP
.LP
csv2odf is a command line tool that can convert a \fIcomma separated value\fR (csv) file into an ods, odt, html, xlsx, or docx document. csv2odf is useful for creating reports from databases and other data sources that produce csv files. csv2odf can be combined with cron and shell scripts to automatically generate business reports.
.LP
The csv data is merged with a \fItemplate\fR file to produce the output file. The template is a document file as produced by LibreOffice or Word, or an html file. The template can be a spreadsheet file (ods or xlsx), a document file (odt or docx), or an html file.
The csv data is merged with a \fItemplate\fR file to produce the output file. The template can be a spreadsheet file (ods or xlsx) or a document file (odt or docx), as produced by OpenOffice.org, LibreOffice, or Word. The template can also be an html file.
.LP
If a csv input file is not specified, input will be taken from standard input (stdin). If an output file is not specified, output will be directed to standard output (stdout). This allows the use of the command in pipes.
.LP
The first row of the table will be treated as a header row. (Override with \-H) The formatting in the second row of cells will be applied to each data cell of the output file.
The first row of the table will be treated as a header row. (Override with \-H) The formatting in the second row of cells will be applied to each data cell of the output file. If the \-a option is used, data will be appended below the last existing row, formatting from the last row will be applied to cells in each new row.
.LP
If the template is a \fIspreadsheet\fR, the second row should contain some data of similar type to the incoming data so that numbers/text/dates can be correctly identified.
.LP
If the template is a \fIdocument\fR, it must contain a table that the csv data will be inserted into. If the first table in the file is not the target, use the \-t options to identify the table number.
.LP
If the template is an \fIhtml\fR file, it must contain a table that the csv data will be inserted into. If the first table in the file is not the target, use the \-t options to identify the table number or table id property. The table may be made using div tags if the \-\-div options is used, in which case a div tag must enclose each cell, each row, and the entire table.
If the template is an \fIhtml\fR file, it must contain a table or div tags that the csv data will be inserted into. If the first table in the file is not the target, use the \-t options to identify the table number or table id property. The table may be made using div tags if the \-\-div options is used, in which case a div tag must enclose each cell, each row, and the entire table.
.LP
If a csv input file is not specified, input will be taken from standard input (stdin). If an output file is not specified, output will be directed to standard output (stdout). This allows the use of the command in pipes.
.LP
In the header or footer of the template, you can insert a \fI[csv2odf-date]\fR tag ("csv2odf-date" enclosed in square brackets). The date tag will be replaced by the current date. The date format can be changed using format codes (see below), for example [csv2odf-date %Y\-%m\-%d] will produce a date like 2008\-02\-04. A date with a day offset from the current date can be created by using +n or \-n, for example [csv2odf-date\-1] would insert the date before today.
.LP
Expand All @@ -45,15 +45,18 @@ date format within csv data is specified by \fIfmt\fR string, see \-D for codes.
\fB\-H\fR
insert the first csv row into the header
.TP
\fB\--comment=\fR<\fitext\fR>
replace [csv2odf-comment] within the document with <text>
.TP
\fB\-S\fR <\fIn\fR>
skip the first n rows of the template file, the header will be the next row after those skipped
.TP
\fB\-t\fR <\fIn\fR>
specify which tab or table to add data to, default first table. For html files, \-t may be followed by a name to match to table id property.
.TP
\fB\-a\fR
append csv data to the end of existing data
.TP
\fB\--comment=\fR<\fitext\fR>
replace [csv2odf-comment] within the document with <text>
.TP
\fB\--div\fR
search for <div> tags instead of <table> (html files only). <div> tags must be nested with levels for table, row, and cell.
.TP
Expand Down
177 changes: 91 additions & 86 deletions doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,143 +24,148 @@ <h2><a name='sect2' href='#toc2'>Description</a></h2>
combined with cron and shell scripts to automatically generate business
reports. <p>
The csv data is merged with a <i>template</i> file to produce the output
file. The template is a document file as produced by LibreOffice or Word,
or an html file. The template can be a spreadsheet file (ods or xlsx),
a document file (odt or docx), or an html file. <p>
If a csv input file is not
specified, input will be taken from standard input (stdin). If an output
file. The template can be a spreadsheet file (ods or xlsx) or a document
file (odt or docx), as produced by OpenOffice.org, LibreOffice, or Word.
The template can also be an html file. <p>
The first row of the table will be
treated as a header row. (Override with -H) The formatting in the second
row of cells will be applied to each data cell of the output file. If the
-a option is used, data will be appended below the last existing row, formatting
from the last row will be applied to cells in each new row. <p>
If the template
is a <i>spreadsheet</i>, the second row should contain some data of similar type
to the incoming data so that numbers/text/dates can be correctly identified.
<p>
If the template is a <i>document</i>, it must contain a table that the csv data
will be inserted into. If the first table in the file is not the target,
use the -t options to identify the table number. <p>
If the template is an <i>html</i>
file, it must contain a table or div tags that the csv data will be inserted
into. If the first table in the file is not the target, use the -t options
to identify the table number or table id property. The table may be made
using div tags if the --div options is used, in which case a div tag must
enclose each cell, each row, and the entire table. <p>
If a csv input file is
not specified, input will be taken from standard input (stdin). If an output
file is not specified, output will be directed to standard output (stdout).
This allows the use of the command in pipes. <p>
The first row of the table
will be treated as a header row. (Override with -H) The formatting in the
second row of cells will be applied to each data cell of the output file.
<p>
If the template is a <i>spreadsheet</i>, the second row should contain some data
of similar type to the incoming data so that numbers/text/dates can be
correctly identified. <p>
If the template is a <i>document</i>, it must contain a table
that the csv data will be inserted into. If the first table in the file
is not the target, use the -t options to identify the table number. <p>
If the
template is an <i>html</i> file, it must contain a table that the csv data will
be inserted into. If the first table in the file is not the target, use
the -t options to identify the table number or table id property. The table
may be made using div tags if the --div options is used, in which case a
div tag must enclose each cell, each row, and the entire table. <p>
In the header
or footer of the template, you can insert a <i>[csv2odf-date]</i> tag ("csv2odf-date"
enclosed in square brackets). The date tag will be replaced by the current
date. The date format can be changed using format codes (see below), for
example [csv2odf-date %Y-%m-%d] will produce a date like 2008-02-04. A date
with a day offset from the current date can be created by using +n or -n,
for example [csv2odf-date-1] would insert the date before today. <p>
The options
may be placed in the template file. To do this, put "csv2odf:" (without
quotes) followed by the options in the first cell (cell A1). Note the first
row will be deleted when it contains options.
<h2><a name='sect3' href='#toc3'>Options for Processing Csv
Data File</a></h2>
In the header or footer of
the template, you can insert a <i>[csv2odf-date]</i> tag ("csv2odf-date" enclosed
in square brackets). The date tag will be replaced by the current date.
The date format can be changed using format codes (see below), for example
[csv2odf-date %Y-%m-%d] will produce a date like 2008-02-04. A date with a day
offset from the current date can be created by using +n or -n, for example
[csv2odf-date-1] would insert the date before today. <p>
The options may be placed
in the template file. To do this, put "csv2odf:" (without quotes) followed
by the options in the first cell (cell A1). Note the first row will be
deleted when it contains options.
<h2><a name='sect3' href='#toc3'>Options for Processing Csv Data File</a></h2>

<dl>

<dt><b>-c</b> &lt;<i>char</i>&gt; </dt>
<dd>use <i>char</i> as delimiter instead of comma. \t will indicate
a tab as the dilimiter. </dd>
<dt><b>-c</b>
&lt;<i>char</i>&gt; </dt>
<dd>use <i>char</i> as delimiter instead of comma. \t will indicate a tab as the
dilimiter. </dd>

<dt><b>-o</b> &lt;<i>spec</i>&gt; </dt>
<dd>specify column order: 2,1,3 = second csv
column will be first column in the output. Also use to leave unchanged
the contents of a template column: 1,2,,3,4 = the 3rd template column is
not overwritten. Useful if a column contains a formula. The formula cell
references will be offset to the correct row. </dd>
<dd>specify column order: 2,1,3 = second csv column will be
first column in the output. Also use to leave unchanged the contents of
a template column: 1,2,,3,4 = the 3rd template column is not overwritten.
Useful if a column contains a formula. The formula cell references will
be offset to the correct row. </dd>

<dt><b>-s</b> &lt;<i>n</i>&gt; </dt>
<dd>start reading at the nth
row of the csv file </dd>
<dd>start reading at the nth row of the csv
file </dd>

<dt><b>-e</b> &lt;<i>n</i>&gt; </dt>
<dd>end reading at the nth row of the csv file </dd>

<dt><b>-d</b> &lt;<i>fmt</i>&gt;
</dt>
<dd>date format within csv data is specified by <i>fmt</i> string, see -D for codes.
For columns identified as dates, the program will attempt to translate
incoming data into the native date coding using the format supplied with
the -d option. If the translation fails, it data will be inserted as text.
In ods files, the program knows which columns are dates by looking for
date formatted cells in the template. In xlsx files you must mark date
cells with the text [csv2odf-date] (csv2odf-date inside square brackets).
</dd>
<dt><b>-d</b> &lt;<i>fmt</i>&gt; </dt>
<dd>date format within
csv data is specified by <i>fmt</i> string, see -D for codes. For columns identified
as dates, the program will attempt to translate incoming data into the
native date coding using the format supplied with the -d option. If the
translation fails, it data will be inserted as text. In ods files, the
program knows which columns are dates by looking for date formatted cells
in the template. In xlsx files you must mark date cells with the text [csv2odf-date]
(csv2odf-date inside square brackets). </dd>
</dl>

<h2><a name='sect4' href='#toc4'>Options for Processing Template File</a></h2>

<dl>

<dt><b>-H</b> </dt>
<dd>insert the first csv row into the
header </dd>

<dt><b>--comment=</b>&lt;text&gt; </dt>
<dd>replace [csv2odf-comment] within the document with &lt;text&gt;
</dd>
<dt><b>-H</b>
</dt>
<dd>insert the first csv row into the header </dd>

<dt><b>-S</b> &lt;<i>n</i>&gt; </dt>
<dd>skip the first n rows of the template file, the header will be the
next row after those skipped </dd>
<dd>skip the first n rows of the
template file, the header will be the next row after those skipped </dd>

<dt><b>-t</b> &lt;<i>n</i>&gt;
</dt>
<dd>specify which tab or table to add data to, default first table. For html
files, -t may be followed by a name to match to table id property. </dd>

<dt><b>-t</b> &lt;<i>n</i>&gt; </dt>
<dd>specify which tab or table to add data
to, default first table. For html files, -t may be followed by a name to
match to table id property. </dd>
<dt><b>-a</b> </dt>
<dd>append
csv data to the end of existing data </dd>

<dt><b>--comment=</b>&lt;text&gt; </dt>
<dd>replace [csv2odf-comment]
within the document with &lt;text&gt; </dd>

<dt><b>--div</b> </dt>
<dd>search for &lt;div&gt; tags instead of &lt;table&gt; (html
files only). &lt;div&gt; tags must be nested with levels for table, row, and cell.
</dd>
<dd>search for &lt;div&gt; tags instead of &lt;table&gt;
(html files only). &lt;div&gt; tags must be nested with levels for table, row,
and cell. </dd>

<dt><b>--template-stdin-ods</b> </dt>
<dd>The template will be passed to std-in and it&rsquo;s format will
be ods </dd>
<dd>The template will be passed to std-in and it&rsquo;s
format will be ods </dd>

<dt><b>--template-stdin-odt</b> </dt>
<dd>The template will be passed to std-in and it&rsquo;s format
will be odt </dd>
<dd>The template will be passed to std-in
and it&rsquo;s format will be odt </dd>

<dt><b>--template-stdin-html</b> </dt>
<dd>The template will be passed to std-in and
it&rsquo;s format will be html </dd>
<dd>The template will be passed
to std-in and it&rsquo;s format will be html </dd>

<dt><b>--template-stdin-xlsx</b> </dt>
<dd>The template will be passed to
std-in and it&rsquo;s format will be xlsx </dd>
<dd>The template will
be passed to std-in and it&rsquo;s format will be xlsx </dd>

<dt><b>--template-stdin-docx</b> </dt>
<dd>The template will be
passed to std-in and it&rsquo;s format will be docx </dd>
<dd>The template
will be passed to std-in and it&rsquo;s format will be docx </dd>
</dl>

<h2><a name='sect5' href='#toc5'>General Options</a></h2>

<dl>

<dt><b>-h</b> </dt>
<dd>displays help
information </dd>
<dd>displays
help information </dd>

<dt><b>-v</b> </dt>
<dd>verbose mode </dd>

<dt><b>-D</b> </dt>
<dd>show a list of date format codes (see below)
</dd>
<dd>show a list of date format codes (see
below) </dd>

<dt><b>-q</b> </dt>
<dd>suppress all warning messages </dd>

<dt><b>-x</b> </dt>
<dd>create an xml output file instead of
odf </dd>
<dd>create an xml output file instead
of odf </dd>

<dt><b>-n</b> </dt>
<dd>do not merge the data into output, use with -x to extract template
Expand Down
Loading

0 comments on commit 4bc6e67

Please sign in to comment.