txdconstruct - text data construction
I will produce some TextData following the formula you give me. Syntax is like that of txdcalc with only the STDOUT data; which means: You access the current data set via variables [1].. [x] (or [0,1]..[0,x] if you really want) and the global arrays A and C via A0..Ax and C0..Cx. You can initialze A and are encouraged to work with that array for custom operations. C has at the moment the only function to provide the data set number with C0 (set it to -1 to stop). A data set is printed to STDOUT only when there is actually some data - so you can check for a condition in the formula and end the construction without creating a last futile line. You can, though, enable easy recursive calculation by initializing the data array (via --data parameter) in which case the data fields will always hold their last values when entering the formula.
Variables: A is for you, C is special: C0 is used for the data set number, C1 for the number of data sets to create, C2 for (C0-1)/(C1-1); (and maybe other stat stuff in C following in future...)
The formula can also be given as stand-alone command line argument (this overrides the other setting).
Example:
txdconstruct -n=200 -i="0,1/3" "[1] += 1; [2] = 4*[2]*(1-[2]);"
gives a trajectory (some steps of iteration) for the logistic map.
These are the general rules for specifying parameters to this program:
txdconstruct -s -xyz -s=value --long --long=value [--] [files/stuff]
You mention the parameters/switches you want to change in any order or even multiple times (they are processed in the oder given, later operations overriding/extending earlier settings. An only mentioned short/long name (no "=value") means setting to 1, which is true in the logical sense. Also, prepending + instead of the usual - negates this, setting the value to 0 (false). Specifying "-s" and "--long" is the same as "-s=1" and "--long=1", while "+s" and "++long" is the sames as "-s=0" and "--long=0".
There are also different operators than just "=" available, notably ".=", "+=", "-=", "*=" and "/=" for concatenation / appending array/hash elements and scalar arithmetic operations on the value. Arrays are appended to via "array.=element", hash elements are set via "hash.=name=value".
The available parameters are these, default values (in Perl-compatible syntax) at the time of generating this document following the long/short names:
0
ignore whitespace at beginning and end of line (disables strict mode) (from Text::NumericData)
undef
comment character (if not set, deduce from data or use #) (from Text::NumericData)
'[#%]*[^\\S\\015\\012]*'
regex for matching comments (from Text::NumericData)
[]
Which configfile(s) to use (overriding automatic search in likely paths); special: just -I or --config causes printing a current config file to STDOUT
give some info that may help debugging
treat empty lines as empty data sets, preserving them in output (from Text::NumericData)
fill value for undefined data (from Text::NumericData)
'[1] = C0'
specify formula here
show the help message; 1: normal help, >1: more help; "par": help for paramter "par" only
Additional fun with negative values, optionally followed by comma-separated list of parameter names: -1: list par names, -2: list one line per name, -3: -2 without builtins, -10: dump values (Perl style), -11: dump values (lines), -100: print POD.
''
initialize data - comma-separated for eval... this enables easy recursive calculations by always preserving the last values
line ending to use: (DOS, MAC, UNIX or be explicit if you can, taken from data if undefined, finally resorting to UNIX) (from Text::NumericData)
10
number of datasets to create (when < 0: until _you_ set C0 to -1)
printf formats to use (if there is no "%" present at all, one will be prepended) (from Text::NumericData)
'[\\+\\-]?\\d*\\.?\\d*[eE]?\\+?\\-?\\d*'
regex for matching numbers (from Text::NumericData)
use this separator for output (leave undefined to use input separator, fallback to TAB) (from Text::NumericData)
Use plain Perl syntax for formula for full force without confusing the intermediate parser.
quote titles (from Text::NumericData)
quote character to use (derived from input or ") (from Text::NumericData)
use this separator for input (otherwise deduce from data; TAB is another way to say "tabulator", fallback is ) (from Text::NumericData)
strictly split data lines at configured separator (otherwise more fuzzy logic is involved) (from Text::NumericData)
1
allow text as data (not first column) (from Text::NumericData)
initialize the additional variable array A (comma-separeted for eval)
print out the program version
Thomas Orgis <thomas@orgis.org>
Copyright (c) 2005-2013 Thomas Orgis, Free Software licensed under the same terms as Perl 5.10
To install Text::NumericData, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::NumericData
CPAN shell
perl -MCPAN -e shell install Text::NumericData
For more information on module installation, please visit the detailed CPAN module installation guide.