dbfilealter - alter the format of an Fsdb file, changing the row/column separator
dbfilealter [-c] [-F fs] [-R rs] [-Z compression] [column...]
This program reformats a Fsdb file, altering the row (-R rs) or column (-F fs) separator. It verifies that this action does not violate the file constraints (for example, if spaces appear in data and the new format has space as a separator), and optionally corrects things.
-R rs
-F fs
With -Z compression it controls compression on the file
-Z compression
Specify the field (column) separator as S. See below for valid field separators.
S
Specify the row separator as S. See below for valid row separators.
Specify file compression as given by file extension S. Supported compressions are gz for gzip, bz2 for bzip2, xz for xz, or "none" or undef to disable compression. Default is none.
Correct any inconsistency caused by the new separators, if possible.
This module also supports the standard fsdb options:
Enable debugging output.
Read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
-
Write to OutputDestination, typically a file name, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
By default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The --(no)autorun option controls that behavior within Perl.
--(no)autorun
Show help.
Show full manual.
Potentially in the future xN and cA will support single-character-on-input equivalents of XN and <CA>.
xN
cA
XN
Three row separators are allowed:
C
#fsdb name id test1 a 1 80 b 2 70 c 3 65
cat data.fsdb | dbfilealter -F S
#fsdb -F S name id test1 a 1 80 b 2 70 c 3 65 # | dbfilealter -F S
cat data.fsdb | dbfilealter -R C
#fsdb -R C name id test1 name: a id: 1 test1: 80 name: b id: 2 test1: 70 name: c id: 3 test1: 65 # | dbfilealter -R C
#fsdb -F S name id test1 a student 1 80 b nice 2 70 c all 3 65
cat correction.fsdb | dbfilealter -c -F D
#fsdb name id test1 a_student 1 80 b_nice 2 70 c_all 3 65 # | dbfilealter -c -F D
Fsdb, dbcoldefine.
$filter = new Fsdb::Filter::dbfilealter(@arguments);
Create a new dbfilealter object, taking command-line arguments.
$filter->set_defaults();
Internal: set up defaults.
$filter->parse_options(@ARGV);
Internal: parse command-line arguments.
$filter->setup();
Internal: setup, parse headers.
$filter->run();
Internal: run over each rows.
Copyright (C) 2008-2018 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.
To install Fsdb, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fsdb
CPAN shell
perl -MCPAN -e shell install Fsdb
For more information on module installation, please visit the detailed CPAN module installation guide.