home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / filutl / gf10.lbr / GF.DZC / GF.DOC
Text File  |  1989-02-28  |  3KB  |  77 lines

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