home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / TEXT / UTILITY / UNEEK101.ZIP / UNEEK.DOC < prev    next >
Encoding:
Text File  |  1990-06-18  |  5.8 KB  |  125 lines

  1.                UNEEK - Eliminate Duplicate Records
  2.                Version: 1.0.1  Date: June 18, 1990
  3.                      Author: Don A. Williams
  4.  
  5. ****************************  NOTICE!  **************************
  6. *   Contrary to the current trend  in  MS-DOS  software  this   *
  7. *   program,  for  whatever  it is worth,  is NOT copyrighted   *
  8. *   (with the exception of the runtime library  from  Borland   *
  9. *   International's  Turbo  C)!  The program,  in whole or in   *
  10. *   part,  may be used freely in any fashion  or  environment   *
  11. *   desired.  If  you  find this program to be useful to you,   *
  12. *   do NOT send any contribution to the author;  in the words   *
  13. *   of  Rick  Conn,   'Enjoy!'  However,   if  you  make  any   *
  14. *   improvements,  I would enjoy  receiving  a  copy  of  the   *
  15. *   modified  source.  I  can  be reached,  usually within 24   *
  16. *   hours,  by  messages  on  any  of  the  Phoenix  systems,   *
  17. *   particularly:                                               *
  18. *                                                               *
  19. *               Bob's Answering Machine [OPUS]                  *
  20. *                   (602) 242-3158   1200/2400 bps              *
  21. *               Radioactive West        [PCBOARD]               *
  22. *                   (602) 873-0810   1200/2400 bps              *
  23. *               The Tool Shop BBS       [PCBOARD]               *
  24. *                   (602) 279-2673   1200/2400/9600 bps         *
  25. *                   (Good luck trying!  VERY BUSY!)             *
  26. *               Technoids Anonymous     [PCBOARD]               *
  27. *                   (602) 899-4876   300/1200/2400 bps          *
  28. *                                                               *
  29. *   All can be reached through PC Pursuit.                      *
  30. *                                                               *
  31. *   or:                                                         *
  32. *                on GEnie, mail address: DON-WILL               *
  33. *                on CompuServ:           75410,543              *
  34. *                                                               *
  35. *   Every  effort has been made to avoid error and moderately   *
  36. *   extensive testing has been  performed  on  this  program,   *
  37. *   however, the author does not warrant it to be fit for any   *
  38. *   purpose  or  to  be  free  from  error  and disclaims any   *
  39. *   liability for actual or any other damage arising from the   *
  40. *   use of this program.                                        *
  41. *****************************************************************
  42.  
  43.  
  44. UNEEK is a program that is  functionally  quite  similar  to  the
  45. "unique"  command  of  Un*x,  it reads through the input file and
  46. retains only the last of duplicate records.  The major difference
  47. between UNEEK and unique is that unique uses  the  entire  record
  48. for   the   determination   of  duplication  and  UNEEK  can  use
  49. user-specified fields.  Unique is also a "filter", i.e.  it reads
  50. from  stdin  and  writes  to  stdout,  and  always  requires  I/O
  51. redirection where UNEEK, by default,  reads from a user-specified
  52. input  file  and  writes  to  an intermediate file.  As with many
  53. MS-DOS programs,  on termination,  UNEEK will rename the original
  54. input  file  to  a  ".BAK" file and rename the output file to the
  55. original input file name.
  56.  
  57.  
  58. Usage:
  59.  
  60.  
  61.     C:>uneek {- | input_file_name} [field_spec ... ]
  62.  
  63.  
  64. If the command line arguments contain a  single,  blank-delimited
  65. '-',  UNEEK will operate as a "filter",  reading input from stdin
  66. and writing output to stdout.  Otherwise, an input file name must
  67. be specified.  This file name is a standard DOS file name and may
  68. contain the full path.
  69.  
  70. The field specifications are optional and,  if none are supplied,
  71. UNEEK  will  use  the  entire line to determine duplication.  The
  72. field specifications can be in either of two forms:
  73.  
  74.     bb:ll[:o] - where  bb  is  the  character  position  of   the
  75.                 beginning  of the field,  ll is the length of the
  76.                 field in characters,  and o is the optional field
  77.                 option.    Currently,    only   'i',   for   case
  78.                 insensitive matching, and 'c', for case sensitive
  79.                 matching,  are supported as field options.  If no
  80.                 field  option  is  specified  for  a  field,  the
  81.                 matching on that field will be case insensitive.
  82.  
  83.     bb:ee[:o] - where  bb  is  the  character  position  of   the
  84.                 beginning  of  the  field  as  before,  ee is the
  85.                 character position of the ending  of  the  field,
  86.                 inclusive,  and o is the optional field option as
  87.                 before.
  88.  
  89. All character positions used by UNEEK are  1-relative,  i.e.  the
  90. first  character  of  the  record is character 1 not character 0.
  91. For example if you wanted to  match  on  a  field  that  occupied
  92. characters  21,  22,  23,  24,  and  25,  you  would  use a field
  93. specifier of 21:5 or 21-25 to describe it.
  94.  
  95.  
  96. Examples:
  97.  
  98. To use UNEEK as a "filter" very  similar  to  the  Un*x  "unique"
  99. command:
  100.  
  101.     C:>uneek - <input_file >output_file
  102.  
  103. This  would  be  a case insensitive match on the entire record to
  104. eliminate duplicates, retaining only the last of any duplicates.
  105.  
  106.  
  107. UNEEK can also be used as a "filter" with field specifications:
  108.  
  109.     C:>uneek - 21:5:c <input_file >output_file
  110.  
  111. which would use a case sensitive match to  eliminate  records  in
  112. which characters 21, 22, 23, 24, and 25 were the same.
  113.  
  114.  
  115. To use UNEEK not as a "filter":
  116.  
  117.     C:>uneek input_file
  118.  
  119. which  would use a case insensitive match on the entire record to
  120. eliminate duplicates from input_file,  retaining only the last of
  121. any  duplicates.  The original input file,  unmodified,  would be
  122. renamed to input_file.BAK.
  123.  
  124. 
  125.