GF - A Generalized Filter Dave Ramsey GF is hereby placed in the public domain, February 1, 1989. The intent of GF is quite simple - to allow the user to replace any character in a specified input file with any other character on a global basis. The reason that I wrote GF was because I frequently get text files that were probably prepared on Un*x systems and which have only bare linefeeds as line terminators. To read these files, I needed a quick tool to change all LFs to CRs; GF fills that bill. In order to use GF, the user must specify four arguments. These are the input file, the output file, the search character and the replacement character. GF allows the user to specify control characters for either the search character or the replacement character by preceding them with a '^'. Likewise, since ZCPR and CPM convert the command line to all uppercase, GF allows the user to specify a lowercase character by preceding that argument with a `~` character. For instance: A0>GF INFILE.TXT OUTFILE.TXT ^J ^M will convert all the linefeeds in INFILE.TXT to carriage returns in the file OUTFILE.TXT. (I've used it often in this mode to clean up documents prepared on Un*x systems since Un*x uses only a bare linefeed as a line terminator.) Likewise, the command: A0>GF INFILE.TXT OUTFILE.TXT Z ~z will convert all uppercase Z's to lower case z's. If invoked with no arguments or the wrong number of arguments, GF will present a help screen to the user. This help screen is presented below: GF, Version 1.0 - A Generalized Filter. Syntax: GF du:fn1 du:fn2 oldch newch Where: du:fn1 is the input file spec; du:fn2 is the output file spec; oldchar is the search character; and newchar is the replacement character., A ^ character before either oldchar or newchar tells GF to convert it to a control character. A ~ character before either oldchar or newchar tells GF to convert it to lowercase. i.e. ^M is a carriage return and ~M is an "m" NOTES: (1) While I've written a number of Turbo Pascal and Turbo Modula-2 programs for my Z80 Ampro system, Ive not had the time to involve myself deeply in Z80 assembly language programs. Job, personal affairs, and many hours of overtime using Fortran on IBM and Unisys mainframes generally dampened my enthusiasm for developing Z80 and Z-System software. This is my first stand-alone Z80 application and except for the changes I made to my Sanyo MBC-1000 BIOS three years ago, is probably the largest Z80 project I've undertaken to date. So if my coding style isnt the best, or if I've made some obviously foolish errors, please be gentle with the criticisms! I want to hear about them but don't need a reprimand. (2) I'm interested in using the Z-System SYSLIB routines as much as possible. If I could have used them better or if there are routines to do things that I have done, let me know. (3) If there are additional things you would like in GF (I can't imagine what else anyone would want in a simple, generalized file filter) leave me a message on Z-Node #3 (Newton Center), Z-Node #2 (Ladera), or Z-Node #24 (Cedar Mill) *OR* go ahead and add it yourself. After all, GF is in the public domain!