ref_tsfutil

tsfutil

TS File utility - tool to convert TSF files from/to JSON or CSV.

Usage: $ tsfutil [global options] command [options] <tsffile> [infile|outfile]

Where global options are:

-s schema.jsonPath to file that contains TSF schema

-F json|jsonraw|csvInput/output tsfutil format - default is json

Subcommand is one of:

  • create creates new TSF file from specified schema
  • count prints number of entries in TSF file
  • get read entries from tsffile and write them to outfile or stdin if it is not specified. By default reads all entries from file. To specify desired range of entries, specify option -g:
    • -g N$ Where N - start entry, M - last entry, and $ - alias for last entry in tsffile.
  • add adds entries from infile to tsffile

Also, one of backend options may be specified using -o option: -o <backend option>

JSON options:

  • one - if getting only one entry, print it alone, not array of single nodes

CSV options:

  • header=<header> - additional CSV header if not specified in CSV file (for 'add' command) or header that would be used during export for 'get' command. You may specify not all columns to create tsffile slice. Also through this option you may provide header hints. For boolean columns you may change default true and false literals:

-o header=somefield:yes:noFor integer values you may append "unsigned" or "hex" hint: -o header=int1:unsigned,flags:hex

  • noheader - if specified for 'get' subcommand, tsfutil don't write header into file. If specified for 'add' subcommand, means that CSV file do not contain valid header and header, specified by 'header=' option should be used.
  • all - for 'get' subcommand - retrieve all fields from tsffile, not just specified in 'header=' option
  • valsep - separator for columns. Default is comma
  • optsep - separator for column hints inside header. Default is semicolon.
1954 Просмотров
Добавить комментарии