Dec 152017
 
Creates columns out of single column text file. Very good!.
File COLS.ZIP from The Programmer’s Corner in
Category Word Processors
Creates columns out of single column text file. Very good!.
File Name File Size Zip Size Zip Type
COLS.DOC 12189 4174 deflated
COLS.EXE 12859 7792 deflated

Download File COLS.ZIP Here

Contents of the COLS.DOC file



COLS 1.00
---------

COLS is a text filter that converts a single column text stream
(like a DIR) to a multicolumn format (like a DIR/W). Supports
both "snaking" columns (newspaper-style) and "horizontal"
columns (again like DIR/W). Can be used either with files or
with redirected input.


Usage
-----
The full syntax is:

cols [/c# /w# /s# /l# /t# /b# /p# /k[+] /h /f infile outfile]

# represents a decimal number (e.g., /W20). All parameters are
optional. Most of them have to do with page formatting (unlike
a simple one-column stream like DIR, a snaked-column report
really needs to be formatted into pages). The parameters are as
follows:

/c Number of columns in output (1-4, default 2).

/w Width of each column (1-80, default 40).

/s Number of spaces to be inserted between each column
(0-20, default 0).

/l Left margin (spaces added before first column; legal
values 0-40, default 0).

/t Top margin (blank lines added before first line of a
page is output; values 0-10, default 2).

/b Bottom margin (blank lines left before end of page;
values 0-10, default 6).

/p Page length in lines (10-200, default 66).

/k Skip blank lines in input file.

/k+ Do not output any blank lines. This is a superset
of /k. If the first nonblank character of a line is
beyond the column width (e.g., the column width is
20, and the first 20 characters are spaces), the
line will appear as a blank line on output with /k,
but it will be suppressed with /k+.

/h Produce "horizontal" columns rather than "snaking"
columns.

/f Soft page: insert extra blank lines at the end of
each page, rather than using a formfeed character.

infile Name of input file. If not present, COLS uses the
standard input device (allowing redirection).

outfile Name of output file. If not present, COLS uses the
standard output device (allowing redirection).

The parameters may be specified in any order (except that INFILE
must precede OUTFILE), and the switches can be strung togther or
separated. Both '/' and '-' are valid as switch characters.

All of these are identical in effect:

COLS /c3 /w15 /s5 /k onecol threecol
COLS onecol -c3 -w15 -s5 -k threecol
COLS onecol threecol /c3w15s5k
COLS onecol threecol -c3-w15-s5-k

Note that a plain COLS command (with no arguments) is perfectly
legal. It produces two-column snaked output; each column is 40
characters wide. There is a 2-line top margin and a 6-line
bottom margin on a 66-line page (producing 58 lines of output).
Input is taken from standard input, and output is sent to the
screen (both can be redirected, of course). Try this:

DIR | COLS


Horizontal vs. snaking columns
------------------------------
Suppose that you have a text file containing these six lines:

one
two
three
four
five
six

Two-column "snaked" output would look like this:

one four
two five
three six

Two-column "horizontal" output would look like this:

one two
three four
five six


Page formatting
---------------
Snaked output needs to be broken into pages to be useful. This
wouldn't make any sense:

1 4
2 5
3 6
7 10
8 11
9 12

You really need this:

1 4
2 5
3 6

7 10
8 11
9 12

COLS knows three things about your pages: how long they are,
how many blank lines to leave at the top, and how many blank
lines to leave at the bottom (normally, 66, 2, and 6, leaving 58
lines of text). You can adjust these to suit your taste. When
there is no room left at the bottom of a page, COLS outputs an
formfeed character (ASCII code 12) and starts the next page. If
you use the /F (soFt page) switch, COLS outputs extra blank
lines at the bottom of each page rather than a formfeed.

For horizontal columns only (/H switch), you can suppress all
page formatting by specifying a page size of zero (/P0).


Column formatting
-----------------
All input lines are truncated if they are longer than the
specified column width (default 40). COLS outputs a number of
spaces equal to the left margin value (/L parameter) to the
left of the first column, and a number of spaces equal to the
separator value (/S parameter) between each succeeding pair of
columns. Try this:

DIR | COLS /l5 /c4 /w12 /s10 /k

and you'll create your own DIR/W (in snaked format). Note how
each of the original directory entries is truncated to the file
name and extension only.


I/O
---
COLS can be used with filenames specified on the command line or
with redirected I/O. You can also specify an input file and then
redirect output. Examples:

cols file1.txt file2.txt
Takes FILE1 and "columnizes" it, leaving the result
in FILE2

cols < file1.txt > file2.txt
Identical in effect to above.

cols file1.txt
Takes FILE1 and "columnizes" it, displaying the
result onscreen

Of course, I/O to COLS can be piped:

dir | cols
Gives COLS the output of DIR to work on.

dir | cols > prn
Columnized DIR is sent to the printer.

dir | cols | xfilt
Output of DIR goes through COLS and then into
another filter program, XFILT.

cols < myfile | list /s
Columnizes contents of MYFILE and sends it to the
program LIST.

If you run COLS with no file specified, and no redirected input
(e.g. just COLS by itself, or COLS > PRN), the input will be
taken from the standard input device, which is the keyboard. In
other words, anything you type will be columnized. In snaked
format, you'd have to type a full page before anything would
happen. COLS realizes that this probably isn't what you
intended, and displays a warning message.


Limits
------
COLS is intended for plain text (ASCII text files or redirected
input). Word processor files are not ASCII text files. They
are binary data files, and COLS will not work with them. You
might as well ask it to columnize a spreadsheet file or a
database (or COMMAND.COM, for that matter).

Input lines cannot exceed 255 characters.


Release history
---------------
Version 1.00 - 12/4/88
First public release


Copyright/License/Warranty
--------------------------
This document and the program file COLS.EXE ("the software")
are copyrighted by the author. The copyright owner hereby
licenses you to: use the software; make as many copies of the
program and documentation as you wish; give such copies to
anyone; and distribute the software and documentation via
electronic means. There is no charge for any of the above.

However, you are specifically prohibited from charging, or
requesting donations, for any such copies, however made; and
from distributing the software and/or documentation with
commercial products without prior written permission. An
exception is granted to not-for-profit user's groups, which are
authorized to charge a small fee (not to exceed $7) for
materials, handling, postage, and general overhead. NO
FOR-PROFIT ORGANIZATION IS AUTHORIZED TO CHARGE ANY AMOUNT FOR
DISTRIBUTION OF COPIES OF THE SOFTWARE OR DOCUMENTATION, OR TO
INCLUDE COPIES OF THE SOFTWARE OR DOCUMENTATION WITH SALES OF
THEIR OWN PRODUCTS.

THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFIT
ORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITH
OTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE OR
ANY OTHER SUCH FEE FOR THE DISTRIBUTION. NO FOR-PROFIT
ORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIA
FOR WHICH MONEY IS CHARGED.

There is no restriction on the use of this software in commercial
or institutional environments.

No copy of the software may be distributed or given away without
this document; and this notice must not be removed.

There is no warranty of any kind, and the copyright owner is not
liable for damages of any kind. By using this free software,
you agree to this.

The software and documentation are:

Copyright (C) 1988 by
Christopher J. Dunford
The Cove Software Group
P.O. Box 1072
Columbia, Maryland 21044

(301) 992-9371
CompuServe 76703,2002 [IBMNET]

----------------end-of-author's-documentation---------------

Software Library Information:

This disk copy provided as a service of

The Public (Software) Library

We are not the authors of this program, nor are we associated
with the author in any way other than as a distributor of the
program in accordance with the author's terms of distribution.

Please direct shareware payments and specific questions about
this program to the author of the program, whose name appears
elsewhere in this documentation. If you have trouble getting
in touch with the author, we will do whatever we can to help
you with your questions. All programs have been tested and do
run. To report problems, please use the form that is in the
file PROBLEM.DOC on many of our disks or in other written for-
mat with screen printouts, if possible. The P(s)L cannot de-
bug programs over the telephone.

Disks in the P(s)L are updated monthly, so if you did not get
this disk directly from the P(s)L, you should be aware that
the files in this set may no longer be the current versions.

For a copy of the latest monthly software library newsletter
and a list of the 1,400+ disks in the library, call or write

The Public (Software) Library
P.O.Box 35705 - F
Houston, TX 77235-5705
(713) 665-7017



 December 15, 2017  Add comments

Leave a Reply