# csv2tbx

Convert between CSV (Comma Separated Value) files and the TBX format for terminology exchange.

## Usage

    csv2tbx [--charset=CHARSET] [--columnorder=COLUMNORDER] <csv> <tbx>

Where:

<csv> | is a CSV file
<tbx> | is the target TBX file

Options (csv2tbx):

`--version` | show program’s version number and exit
`-h, --help` | show this help message and exit
`--manpage` | output a manpage based on the help
`--progress=PROGRESS`
| show progress as: dots, none, bar, names, verbose
`--errorlevel=ERRORLEVEL`
| show errorlevel as: none, message, exception, traceback
`-i INPUT, --input=INPUT`
| read from INPUT in csv format
`-x EXCLUDE, --exclude=EXCLUDE`
| exclude names matching EXCLUDE from input paths
`-o OUTPUT, --output=OUTPUT`
| write to OUTPUT in tbx format
`-S, --timestamp`
| skip conversion if the output file has newer timestamp
`--charset=CHARSET`
| set charset to decode from csv files
`--columnorder=COLUMNORDER`
| specify the order and position of columns (comment,source,target)

## CSV file layout

The CSV file is expected to have three columns (separated by commas, not other characters like semicolons), of which the default layout is

Column | Data | Description
--- | --- | ---
A | Comment | All the PO #: location comments. These are not used in the TBX files, and can be left empty, but could be generated by po2csv
B | Source Language | The msgid or source string
C | Target Language | The msgstr or target language

## Examples

These examples demonstrate the use of csv2tbx:

    csv2tbx terms.csv terms.tbx

to simply convert terms.csv to terms.tbx.

To convert a directory recursively to another directory with the same structure of files:

    csv2tbx csv-dir tbx-target-dir

This will convert CSV files in csv-dir to TBX files placed in tbx-target-dir.:

    csv2tbx --charset=windows-1250 csv tbx

Users working on Windows will often return files in encoding other the Unicode based encodings. In this case we convert CSV files found in csv from windows-1250 to UTF-8 and place the correctly encoded files in tbx. Note that UTF-8 is the only available destination encoding.

## Two column CSV

    csv2tbx --columnorder=source,target foo.csv foo.tbx

## Notes

For conformance to the standards and to see which features are implemented, see CSV and TBX.