fmtcolumn - format selected columns
fmtcolumn [options] [-R] column fmt [ [-R] column fmt] ...
fmtcolumn -r 'hoo_\d+' 'boo_\d+' %.4f
indicates that all columns contain Perl regular expressions, while
fmtcolumn 'hoo_\d+' -R 'boo_\d+' %.4f
indicates that only the second column specification is a regular expression; the first column specification must match a column name exactly
Format selected columns according to the Perl sprintf formatting commands specified. Other columns are left untouched. Chars that are special to the UNIX shell must be quoted. Column name specifications may contain Perl regular expressions (see the -r and -R options ).
This operator reads an rdbtable via STDIN and writes an rdbtable via STDOUT. Options may be abbreviated.
For example, if the input rdbtable, sample1, looks like this:
composition energy eps_i eps_r
----------- ------ ----- -----
ir 2.0100037999999 0.00020474961 0.9990628891
ir 2.0150032000000 0.00020219905 0.9990769028
ir 2.0200040999999 0.00019891983 0.9990938154
The following command
fmtcolumn energy %.5f eps_i %e eps_r %f
produces:
composition energy eps_i eps_r
----------- ------ ----- -----
ir 2.01000 2.047496e-04 0.999063
ir 2.01500 2.021991e-04 0.999077
ir 2.02000 1.989198e-04 0.999094
Diab Jerius ( djerius@cfa.harvard.edu )