Daylight v4.9
Release Date: 1 February 2008

Name

tdtcount - count bytes, dataitems and TDTs in a TDT file

Unix Synopsis

tdtcount [options] [file ...]tdtcount options

Description

tdtcount reads TDTs (Thor Datatrees) from its input file(s) and reports the number of bytes, identifiers, non-identifiers, SMILES, and TDTs. If more than one file is specified, it also reports the total counts for all files.

An input file named "-" indicates that standard input is to be used; for example, "tdtcat foo.tdt - bar.tdt" will examine foo.tdt, then examine standard input until EOF (end-of-file) is encountered, then will examine bar.tdt. If no file is specified, standard input is used.

Output consists of six space-separated fields:

bytes ids nonids smiles tdts inputfile
Where:
bytes - sum of bytes in all TDTs
ids - number of identifier dataitems
nonids - number of non-identifier dataitems
smiles - number of $SMI<> dataitems
tdts - number of TDTs
inputfile - name of input file
Note that the number of non-SMILES TDTs can be computed as (tdts - smiles), and the number of cross-references can be computed as (ids - tdts).

Empty "whitespace" between TDTs and dataitems is not counted in the byte count, e.g. "$SMI<C> NAM<METHANE> |" would be counted as 20 bytes even though the string is 22 bytes.

Options

-SKIP_RECORDS N
Indicates that the first N TDTs in the file(s) are to be ignored. Default is zero (don't skip any).
-DO_RECORDS N
Count items N TDTs, report the results then quit. Default is -1 (do all records).
-VERBOSE [TRUE|FALSE]
If TRUE, a more readable output is printed. If FALSE, output is terse. Default is FALSE.

Return Value

Returns status zero if it can read and report as requested, or zero if a problem is detected, such as not being able to read an input file.

Files

$DY_ROOT/bin/tdtcount

Daylight License

No license required.

Related Topics

dayevict(1) daymessage(1) merlindbping(1) merlinload(1) merlinls(1) merlinping(1) merlinwho(1) thorchange(1) thorcrunch(1) thordbping(1) thordelete(1) thordestroy(1) thordiff(1) thordump(1) thorlist(1) thorload(1) thorlookup(1) thorls(1) thormake(1) thorping(1) thorwho(1)

sthorman(1) thorserver(1) merlinserver(1)

Daylight Theory Manual, Daylight System Administration Manual

Bugs

tdtcount reads each TDT into memory before printing any of it. Thus its process size will grow to at least as large as the largest TDT that must be processed.

If a TDT file contains an unbalanced quote ("), tdtcount will try to find the matching quote regardless of how far it goes. Typically, this will result in it trying to read the entire remainder of the TDT file into memory, resulting in an "OUT OF MEMORY" error.