home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15232 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!spool.mu.edu!enterpoop.mit.edu!linus!philabs!crpmks!marcs
  3. From: marcs@crpmks.uucp (Marc Snyder)
  4. Subject: File manipulation question
  5. Organization: CIBA-GEIGY Corporation, Additives Division
  6. Date: Thu, 7 Jan 1993 01:04:50 GMT
  7. Message-ID: <1993Jan7.010450.28001@crpmks.uucp>
  8. Lines: 28
  9.  
  10. Hello all,
  11.     I have a quick question for everyone.  I have some files that are
  12. in the format:
  13.  
  14. AA1  01234 ....
  15.     junk     junk   junk
  16.         junk                    junk
  17. C1K  98765 ....
  18.                    junk          junk
  19. COM  12121 ....
  20.  junk
  21.  
  22.  
  23. where the first three characters of a valid line are 3 alpha and or numeric 
  24. characters, followed by two spaces, and then a sequence of 5 numbers.  Each 
  25. line is ~100 characters long, and I'm not concerned with checking anything 
  26. after the 5 digit code.  Also, there are lines of text between these valid 
  27. lines, that have other misc text in them.  I'd like to run these files through 
  28. a script that will pull out lines that look like the valid ones above, place 
  29. them in a new file, and ignore the other lines.  The data at the end of these 
  30. valid lines is important, but doesn't need to be checked for validity.  If a 
  31. line begins like the valid ones above, it's a keeper.  If anyone can
  32. help, I'd really appreciate it.  Thanks a bunch! 
  33. -- 
  34. Marc Snyder                     UUCP: ...philabs!crpmks!marcs
  35. System Administrator                  
  36. Ciba-Geigy Corporation
  37. Hawthorne, New York          Work: 914.785.2284      Play: 914.347.6440
  38.