Команды SFK


    1        2        3        4        5        6        7        8        9        10    

Раздел 3. Conversion - Преобразование
bin-to-src | chars | crlf-to-lf | csvtotab | dec | decode | detab | encode | entab | hex | hexdump | hextobin | join | lf-to-crlf | oload | scantab | split | tabtocsv | utoa | uuencode | wtoa | wtou |


Help:   Рус   |   Eng        Refer:   Рус   |   Eng  

Команда: tabtocsv

Convert tab separated text data to comma separated .CSV output


with the free Swiss File Knife for Windows, Mac OS X and Linux.
sfk tabtocsv infile.txt [options]

convert plain tab separated data to csv.

default input/output format
- input fields are separated by a tab and should
  not be surrounded by quotes, as these are not
  interpreted. input fields themselves cannot
  contain TAB characters.
- output fields are separated by comma ","
- output fields are surrounded by quotes "
  if input contains a comma or quote
- if input contains quotes it is escaped as ""

options
  -tofile x     write output to file x
  -quotetext    surround all text by quotes
  -quoteall     surround all output by quotes
  -outsep="x"   change output separator to
                character x, e.g. ; or \t
  -quote="x"    change quote character

web reference
   http://stahlworks.com/sfk-tabtocsv

examples
  sfk tabtocsv in.txt -tofile out.csv
     convert tab separated to csv in default format
  sfk csvtotab -quote="\x27" -insep=";" in.csv -tofile tmp.tsv
     reads a CSV with input fields separated by semicolon and
     surrounded by single quotes ' with ASCII code hex 27
  sfk tabtocsv -outsep=";" -quote="\x27" tmp.tsv -tofile out.csv
     converts tab separated to an output CSV, with output fields
     separated by semicolon and surrounded by single quotes