2009年5月26日星期二

expand comma-separated-value to tab-separated with this one-liner

pp -E 'use Text::CSV::Encoded; use Text::CSV_PP; use Text::CSV::Encoded::Coder::Encode; $c=Text::CSV::Encoded->new({encoding=>q(utf8),always_quote=>1});say join qq(\t), @$a while $a=$c->getline(STDIN)' -o bin/csv2ssv

# Text::CSV_PP and Text::CSV::Encoded::Coder::Encode will be load by perl but not for pp at this stage.

没有评论: