
Purpose
-------

XCOLS reads a flat text file, or standard input, as columnar data and
prints selected data columns from the input. It extracts and can
exchange them. The result is written to standard output.

Data columns can be inserted into a text template given in the command
line. Column numbers start at 1, not 0.

Examples:

        XCOLS ~7 send to ~6 < infile.txt

Reads infile.txt, prints whatever is found in column 7, then 'send'
and 'to', then whatever is found in column 6. The '~' character being
used to designate an input parameter, be careful when using it
otherwise.

        DIR | xcols File ~1.~2 "was   created" at ~$

DIR sends the output to XCOLS. XCOLS replaces ~1 and ~2 with whatever
it finds in the first and second column, and ~$ with whatever it finds
in the *last* column. The quotes will keep the extra space between
'was' and 'created'.

        DIR /B | FIND /i /v "ZED" | XCOLS copy ~1 \dump > dumpit.bat

Gets a directory listing of all file names not containing the string
"ZED" and passes the results to XCOLS. XCOLS replaces ~1 with the name
found and writes the "copy filename.ext to \dump" commands to file
dumpit.bat. A batch file is therefore created which will copy all
files not containg "ZED" in their names to directory \DUMP .

Known limits: If a given column doesn't exist, nothing is printed. The
line lenght for the input file cannot exceed 20 K or 5000 words. The
command line cannot exceed 256 characters.

Written in ANSI C for MS-DOS 6.2.

*** I wrote and tested this program for my personal use. Feel free to
use it if you find it ok yourself. I will appreciate bug reports, but
due to lack of time it is unlikely that I might be able to do anything
about it until I get annoyed by that particular bug. Sorry about that.


Installation: Throw it somewhere in the path.

Status: Freeware, unsupported.

Distribution: free.

Contacting the author: jcm@mail.EUnet.pt

