csv2tsv
0.55 (2018-07-09 Mon)
csv2tsv [-t str] [-n str] [-v] [-Q] [-2] [-~] file
Transforms CSV formatted data (cf. RFC4180) into TSV formated data. Input is assumed to be UTF-8. (The input line ends can be both CRLF or LF. The output line ends are LF.) Warnings/errors would be properly printed on STDERR (as far as the author of this program experienced).
csv2tsv file.csv > file.tsv
csv2tsv -n '[\n]' file.csv > file.tsv # "\n" in the CSV cell will be transfomed to [\n].
csv2tsv -t TAB file.csv > file.tsv # "\t" in the CSV cell will be transfomed to "TAB". UTF-8 characters can be specified.
for i in *.csv ; do csv2tsv -n'"\n"' -t'"\t"' $i > ${i/csv/tsv} ; done # BASH or ZSH is required to use this "for" statement. Useful for multiple CSV files.
For the safety, when '-t' or '-n' is set with string character specification, a warning is displayed every time a values in the input cells matches the specified string charatcter unless -Q is set.
csv2tsv < file.csv > file.tsv # file name information cannot be passed to "csv2tsv". So the warning messages may lack a few information.
Escape character(s) to be used to attach previous to the string matched to the string specified by -t or -n.
What the input TAB character will be replaced with is specified.
What "\n" character in the input CSV cell will be replaced with is specified.
Set CSV field separator anything different from ",".
Always tell the existence of "\t" or "\n" even if "-t str" or "-n str" is specified.
No warning even if "\t" or "\n" is included in the cell of input.
Double space output, to find "\n" anormality by human eyes. (For a kind expediency when this program author was firstly making this program)
The opposite conversion of csv2tsv, i.e. TSV to CSV conversion. TABs and LINEENDs will be recovered if the intput was generated by this program "csv2tsv" with the same specification of "-t", "-n" and "-e".
Always enclose all the fields by the double quotations when transforming TSV to CSV.
Shows this help.
Shows Japanese help.
Shows the version information of this program.
Toshiyuki Shimono bin4tsv@gmail.com
2015-09-28 : Firstly created on a whim. 2016-07-06 : Some options are added such as -2. 2016-08-03 : Response to tab and enter characgers. 2018-06-24 : Once realeased on CPAN for the sake of Table::Hack. 2018-07-04 : Refinements to options. English manual is added. 2018-07-09 : -s and -a is added. Enabled to show the error input by Text::CSV_XS.
Copyright 2018 "Toshiyuki Shimono".
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
To install App::Bin4TSV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Bin4TSV
CPAN shell
perl -MCPAN -e shell install App::Bin4TSV
For more information on module installation, please visit the detailed CPAN module installation guide.