Dec 132017
 
Search and replace for ASCII text files.
File CHANG301.ZIP from The Programmer’s Corner in
Category Word Processors
Search and replace for ASCII text files.
File Name File Size Zip Size Zip Type
BRUCE301.DOC 19329 6870 deflated
CHANGE.DOC 7673 3162 deflated
CHANGE.EXE 68734 44715 deflated

Download File CHANG301.ZIP Here

Contents of the BRUCE301.DOC file


BRUCE301.DOC
01/08/93

This documentation provides some overview information on a number of utilities
that have been posted. All utilities were written by Bruce Guthrie of Wayne
Software and are free for use.

The utilities are uploaded with a ZIP name that includes the year and month of
the release. These names are:

ADDymm.ZIP ADD program
BFINDymm.ZIP BFIND program
CHANGymm.ZIP CHANGE program
CONCTymm.ZIP CONCAT program
CONVRymm.ZIP CONVERT program
DIRCMymm.ZIP DIRCOMP program
DIRTOymm.ZIP DIRTOTAL program
FILLymm.ZIP FILL program
FILUPymm.ZIP FILUPDAT program
FIXCHymm.ZIP FIXCHARS program
MULCOymm.ZIP MULTICOL program
READymm.ZIP READ program (with READMAKE)
TAKE1ymm.ZIP TAKE1ST program

This collection of utilities were compiled using QuickBASIC 4.5, frequently with
the help of Thomas G. Hanlin III's PBClone routines. Each of the utilities are
separately described in a like-named *.DOC file. This documentation
(BRUCEymm.DOC--the file release date is indicated by the "ymm" parameter) serves
to summarize what the various utilities consist of.

Several utilities expect you to have a sorting program in your path. You can
use either Vern Buerg's SORTF program, Ben Baker's QSORT program, DOS's own SORT
program, or a slow internal sort program in the routines themselves. The
utilities which require this sorting are DIRCOMP and DIRTOTAL (although DIRTOTAL
makes it optional if you're using MS-DOS 5.0).

Several of the routines have defaults that can be changed by the program
BGCONFIG.EXE which is included in the appropriate ZIP's.

I'm looking at redoing them using VisualBASIC for DOS but haven't really gotten
into that product yet. I've got to admit, I'm not a GUI sort of guy.


All utilities here were written by Bruce Guthrie of Wayne Software. Some were
written to fill specific needs at the U.S. Department of Commerce; they are
copyrighted but can be freely distributed provided the programs and associated
documentation files are kept intact. The programs are freeware, not shareware.
They work for me but I'm not responsible for problems they cause for you.
Comments and suggestions can be sent to:

Bruce Guthrie
113 Sheffield St.
Silver Spring, MD 20910

Other addresses:
BITNET BGU@NIHCU
Internet [email protected]

CompuServe users can reach me through the Internet address.

If you'd actually like me to pay to write programs for you (or to set up
batch files and menus or something), drop me a line!

--------------------------------------------------------------------------------

A summary of each routine follows. See the associated *.DOC files for fuller
explanations:

ADD.EXE: Adds up a column of numbers in a text file. Also presents minimum and
maximum information. Syntax:

ADD infile [ /COLUMNS { col1/col2 | col1 colct } ]
[ /SKIP ] [ /Q ] [ /? ]

BFIND.EXE: Allows Boolean-type FIND requests. For example, find any line with
one string AND another one, or any line with one string OR another. The syntax
shown below is limited since "search" allows a lot of choices.

BFIND [ /V | /-V ] [ /C | /-C ] [ /N | /-N ] [ /I | /-I ] [ /P | /-P ]
[ /-HEAD | /HEAD ] { search } infile [ /? ] [ >filename ]

BGCONFIG.EXE: Lets you change some of the defaults for some of the programs in
BRUCEymm.ZIP. Syntax:

BGCONFIG [ routine ] [ /MONO | /-MONO ] [ /? ]

CHANGE.EXE: Processes change commands in files. Files can be of any size and
type (e.g. binary or text) and are processed quickly. Up to twemty-five change
commands can be processed in a single pass. Also provides ability to remove
trailing spaces from text files. Syntax:

CHANGE filename [ commandfile | FROM string TO string [ IN string ] ]
[ /Nnew_file ] [ /Fflag_file ] [ /Ttemp_file ]
[ /BINARY | /TEXT ] [ /TRIM ] [ /CASE ] [ /VERIFY ] [ /Q ] [ /? ]

CONCAT.EXE: Concatenates a series of files together. Can use wildcards or an
input file. Syntax:

CONCAT [ filespec | @filespec | [drive:]filespec+ ] outfile
[ /OVERWRITE | /APPEND ] [ /BINARY | /TEXT [ /CRLF ] ]
[ /LRECL=nnn [ /BLKSIZE=nnnn ] ] [ /NAMED ] [ /BEEP ] [ /Q ] [ /? ]

CONVERT.EXE: Converts between data formats: FROM dBase, ASCII-delimited
(commas between fields and quotes around strings), and fixed field TO Lotus WKS,
ASCII-delimited, dBase, and fixed field. Syntax:

CONVERT infile [ outfile [ deffile ] ] [ /OVERWRITE ] [ /DEF=defile ]
[ /FROM { FIXED | ASCII | ASCII=char | DBF } ]
[ /FIXED | /ASCII | /ASCII=char | /DBF ] [ /USEDEF | /NODEF ]
[ /TO { FIXED | ASCII | ASCII=char | WKS | DBF } ] [ /HEADER | /-HEADER ]
[ /SKIP | /MISSING | /ABORT ] [ /SAS ] [ /BEEP | /-BEEP ] [ /Q ] [ /? ]

DIRCOMP.EXE: Updates files in one subdirectory based on files in another
subdirectory. Similar to DOS' REPLACE commands in some ways but also removes
unused files and can report what it's doing. Needs an external sorting program
in your path although /SORT=INTERNAL can be used. Syntax:

DIRCOMP directory1 directory2 [ /ALL ] [ /UPDATE ] [ /KILL ]
[ /NETWORK ] [ /Ffilename | /FNUL: ] [ /SORT=pgm ]
[ /OVERWRITE | /APPEND ] [ /Q ] [ /? ]

DIRTOTAL.EXE: Prepares report showing files in subdirectory or drive. Allows
some restriction requests (show only files with date greater than a certain
value). Similar to Norton's FF and Ray Van Tassle's WIZ command (which is a
great program but it doesn't work on network or CD-ROM discs) but presents a
more formal report. Needs an external sorting program in your path (unless
you're using MS-DOS 5.0 and above) although /SORT=INTERNAL can be used. Syntax:

DIRTOTAL [ [ drive: ] ... [drive:][filespec] |
[ drive: ] ... [drive:]\path[\filespec] ]
[ /NL ] [ /S { GT | GT | LT | LE | EQ | NE } value ]
[ /D { GT | GT | LT | LE | EQ | NE } mm/dd/yy ]
[ /ATTR=attr ] [ /Ffilename ] [ /SPLIT ] [ /SORT=pgm ]
[ /Z ] [ /-DOS | / DOS ] [ /BEEP | /-BEEP ] [ /Q ] [ /? ]

FILL.EXE: Program designed to fill up floppies with the maximum number of files
that will fit into them. "FILL *.BAS" will copy *.BAS files onto a floppy,
taking the biggest files first. When it can't fit a file, it will skip it and
move the next one. Syntax:

FILL [ source-filespec ] [ dest-drive: | dest-drive:\path\ ]
[ /OVERWRITE | /-OVERWRITE ] [ /PROMPT | /-PROMPT ] [ /Ox | /O-x ]
[ /Xfilespec ]... [ /WIPE | /-WIPE ] [ /BEEP | /-BEEP ] [ /Q ] [ /? ]

FILUPDAT.EXE: Program which compares a selected list of files in a source path
against those in another path and copies those that have been updated. Similar
to DOS' REPLACE command but works from a stored list of files and can handle any
number of directories. Syntax:

FILUPDAT control_file [ /Flist_file [ /OVERWRITE | /APPEND ] ]
[ /FULL ] [ /ALL ] [ /Q ] [ /? ]

FIXCHARS.EXE: Program which removes non-standard print characters from a text
file. Translates graphics characters into their ASCII equivalents. Also
expands tabs and removes backspaces. Is primarily intended for people who have
problems printing a file. Syntax:

FIXCHARS infile { outfile [ /OVERWRITE ] | /REPLACE }
[ /BINARY | /TEXT ] [ /Ffilename ] [ /Q ] [ /? ]

MULTICOL.EXE: Program creates multiple column listings from straight ASCII
text, ASCII-delimited text, or dBase files. Also does subtotalling. Syntax:

MULTICOL infile outfile [ /OVERWRITE ] [ /DELIM="string" ]
[ /LINES=n ] [ /WIDTH=n ] [ /EJECT ] [ /-EJECT ]
[ /COLUMNS=n ] [ /WRAP | /-WRAP [ /INDENT=n ] | /REFLOW ]
[ /Ccontrol_file ] [ /SETUP="string" ] [ /RESET="string" ]
[ /{ TITLE | HEADER | FOOTER }[ R | C | L ][ 1 to 5]="text" ]
[ /{ TITLE | HEADER | FOOTER }{ T | B }="string" ]
[ /FROM ASCII | /FROM ASCII=char | /FROM DBF ] [ /DEF=deffile ]
[ /SKIP | /MISSING | /ABORT ] [ /GAP=n ] [ /USEDEF ] [ /TALLY ]
[ /SUM={ col_spec | var_spec } ] [ /BREAK={ col_spec | var_spec} ]
[ /PRINT={ col_spec | var_spec } ] [ /? ]

READ.EXE: Simplified version of a file browser. Only works with files of
16,000 lines or less (maybe 800,000 bytes). Other text viewers are out there.
This one has some advantage because it's free. Syntax:

READ [ filespec ] [ /line ] [ /MONO | /-MONO ] [ /? ]

READMAKE.EXE: Program which takes an ASCII-text file and makes it self-viewing.
Provides same capabilities as the READ program. Syntax:

READMAKE infile [ outfile ] [ /OVERWRITE ] [ /DATE=FILE | /DATE=TODAY ]
[ /TITLE="text" ] [ /? ]

TAKE1ST.EXE: Program that takes only the first occurrence of a record in a text
file. Useful way to get rid of duplicates. Syntax:

TAKE1ST infile outfile [ /COLUMNS { col1/col2 | col1 colct } ]
[ /OVERWRITE | / APPEND ] [ /UNIQUE | /DUPLICATES ] [ /Q ] [ /? ]

-------------------------------------------------------------------------------

Other utilities that I've written that I might clean up and release if requested
include the following:

COPSINCE.EXE: Copies files created since a given date to another subdirectory.

DATES.EXE: Reminds you in advance of birthdays, special events, etc so you
can get cards out in time or get out of time before hand.

NETSORT.EXE: Rather slow directory sorting program (physically arranging the
files in a particular order) which works on files on a network (at least on a
Banyan network).

SPLITREC.EXE: Splits up fixed length files without carriage return/line feeds
into individual text records based on record lengths.


I suspect there are better shareware/freeware versions of these out there. In
any case, if you want a complete release of everything, send $10 to the address
above and I'll send you everything.

I've already written a something called The DEMO System which will be making its
appearance on bulletin boards in January 1993. Unlike the other programs, this
one is being released as shareware, my first attempt at that since I wrote some
music programs years ago.


================================Revision history================================

Release 93/01:

BFIND: Fixed a bug which wouldn't let you search for any string that began
with a dash.

CHANGE: If /TRIM was used and no specific changes were specified, the program
didn't notice anything had changed so it never kept the output file. Fixed
this.

CONVERT: Added /SAS option. Added /HEADER option and fixed up a number of
errors in the Lotus 1-2-3 format (EOF characters weren't being written, column
widths weren't being set, and 0-width columns were being written out).

READ: Added mouse bar if a supported mouse is detected.

READMAKE: Dropped READMAKE.ADD requirement. The program had the necessary
viewer concatenated to itself.

The DEMO System: Initial release. Shareware. Is not covered in the normal
BRUCEymm.DOC file.

--------------------------------------------------------------------------------

Release 92/12:

BFIND: Fixed up some minor glitches involved in parsing some user arguments.

FILL: Added /Ox and /O-x parameters. Since I'm increasingly using this command
to copy files to a Banyan network, and I don't want to have to always use
NETSORT to sort the files there, I've found it desirable to specify an order to
the output files. If anyone cares, I can add /Ox and /O-x to the list of things
handled by BGCONFIG. In any case, adding this parameter required a change in
the way the files are actually processed; duplicate files on the destination
disk are deleted before any files are copied now. Also, the routine used to
show on-going file counts as "(current copied: current sequence)" whereas now
the counts will show "(current copied: total which will be copied)". Also
added /Xfilespec option.

MULTICOL: Major changes here. Added support for ASCII-delimited and dBase
input files, adding a whole bunch of parameters. Then added /SUM, /BREAK,
/TALLY, and /PRINT options. It's possible that a number of options don't work
together all that well. Let me know!

--------------------------------------------------------------------------------

Release 92/11:

Added two new routines this time--MULTICOL and READMAKE--making the count 15.
The BRUCEymm.ZIP idea (having all files in the same ZIP) was creating ZIP's that
were huge so switched to separate ZIP's for each major routine. Makes it harder
to get them all together in one spot but that's life. Send me $10 to the
address above (with disk size specification) and I'll send you the whole
collection.

BFIND: Fixed a bug that ignored Boolean requests if they weren't enclosed in
parentheses.

BGCONFIG: Recoded so only those programs which are actually available when show
up when you load it.

CHANGE: Fixed a bug that lost characters when the replacement string was a
different length from the source string.

FILL: Added /OVERWRITE and /-OVERWRITE switches. Previously, files in the
output directory were automatically overwritten (/OVERWRITE). The default is
now to skip them (/-OVERWRITE).

READ: Used memory for storing more text so fewer disk reads are necessary and
the program is faster. Added the companion program READMAKE.EXE.

--------------------------------------------------------------------------------

Release BRUCE210.ZIP:

Added two new routines this time--BFIND and BGCONFIG--making the count 13.
Added *very* limited mouse support to some of the routines. The BBS I used for
uploading these files (Your Place) was down most of September so I couldn't
post the new files.

CONVERT: Added back in support for writing out dBase files. Speeded up writing
out numeric fields. Added /ABORT option (the alternative to /ABORT and /SKIP).
Added "/FROM format" as a synonym for just "/format". Added BGCONFIG support.

DIRTOTAL: Switched /NODOS to /-DOS (although the old version works). Added
/-BEEP and /DOS (reversing /BEEP and /-DOS). Added BGCONFIG support.

FILL: Added /-PROMPT and /-BEEP options (reversing /PROMPT and /BEEP). Added
BGCONFIG support.

READ: Added Alt-J (or Alt-G) to jump to DOS. Added /-MONO option (reverse of
/MONO). Added BGCONFIG support. Added the graphic.

--------------------------------------------------------------------------------

Release BRUCE208.ZIP:

Skipped awhile due to vacations, beta testing for PC Tools, and playing with
Microsoft's Professional Development System (which I had trouble with so I
returned it). Also had a problem since I only distribute this through one
bulletin board and it was down much of the time. Added one
routine--FIXCHARS--to the collection this time, making the count 11.

ADD: Switched most optional parameters so they need to start with "/" (or "-").
In most cases though, the parameter can also be used without the "/".

CHANGE: Switched most optional parameters so they need to start with "/" (or
"-"). In most cases though, the parameter can also be used without the "/".

CONCAT: Added NAMED option for concatenating text files where you wanted to be
told what the names of the input files were (ala DOS' FIND command). Added
/BEEP option. Now runs much quicker if you don't specify a new file name (it
always ran pretty quickly if you did specify a new file name). Switched most
optional parameters so they need to start with "/" (or "-"). In most cases
though, the parameter can also be used without the "/".

CONVERT: Dropped support for writing out dBase files. Added /MISSING parameter
for ASCII-delimited input files.

DIRCOMP: Added my own copying subroutine which speeds things up a bit. Allowed
multiple choices for sorting programs including SORTF, QSORT, DOS's SORT
command, and a slow internal sorter. Switched most optional parameters so they
need to start with "/" (or "-"). In most cases though, the parameter can also
be used without the "/".

DIRTOTAL: Added the /NODOS option to avoid using MS-DOS 5.0 internal DIR
sorting if desired. Also restores showing of file attributes. Added ability to
handle multiple drives in one pass. Added /BEEP option. Allowed multiple
choices for sorting programs including SORTF, QSORT, DOS's SORT command, and a
slow internal sorter. Switched most optional parameters so they need to start
with "/" (or "-"). In most cases though, the parameter can also be used without
the "/".

FILL: Built in my own MOVE command which was fast enough to justify removing
the DOS option. Switched the to/from parameters to be consistent with the DOS
COPY command (as well as most MOVE commands). Added /BEEP option. Added
ability to move files to a specified subdirectory which makes moving between
hard disks easier. When the files are being copied, a "percentage copied"
figure will now show up. Switched most optional parameters so they need to
start with "/" (or "-"). In most cases though, the parameter can also be used
without the "/". Added Esc capability. Added some transfer rate statistics.

FILUPDAT: Added my own copying subroutine which speeds things up a bit.
Switched most optional parameters so they need to start with "/" (or "-"). In
most cases though, the parameter can also be used without the "/". Added
/APPEND option.

READ: Added Alt-E support for 43- and 50-line screen modes for EGA and VGA
users respectively. Added Alt-R to show a ruler. Switched most optional
parameters so they need to start with "/" (or "-"). In most cases though, the
parameter can also be used without the "/". Added "/line" option. Added # and
G to goto a specific line in the file. Added + and - to skip a certain number
of lines.

TAKE1ST: Switched most optional parameters so they need to start with "/" (or
"-"). In most cases though, the parameter can also be used without the "/".
Added /APPEND option.

--------------------------------------------------------------------------------

Release BRUCE205.ZIP:

CHANGE: Increased number of changes per pass from 10 to 25. Also fixed error
message that showed up when it got rid of its temporary file.

DIRTOTAL: Added support for DOS 5.0 increased DIR functionality. Will
automatically detect DOS 5.0's presense and not need SORTF program unless the /Z
option is requested.

FILL: Fixed error that happens when you try to fill from a subdirectory with
non-empty child subdirectories.

READ: Expanded program to handle up to 16,000 lines. Added Tab and Shift-Tab
to move 8 columns to the right or left.

TAKE1ST: Fixed problem which resulted in first record being considered a
duplicate record if it was empty.

--------------------------------------------------------------------------------

Release BRUCE204.ZIP:

Initial release. Had ten programs: ADD, CHANGE, CONCAT, CONVERT, DIRCOMP,
DIRTOTAL, FILL, FILUPDAT, READ, and TAKE1ST.



 December 13, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)