home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15322 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!swrinde!emory!ogicse!reed!romulus!merlyn
  2. From: merlyn@ora.com (Randal L. Schwartz)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: File manipulation question
  5. Message-ID: <MERLYN.93Jan8084158@romulus.reed.edu>
  6. Date: 8 Jan 93 16:42:03 GMT
  7. Article-I.D.: romulus.MERLYN.93Jan8084158
  8. References: <1993Jan7.010450.28001@crpmks.uucp> <1ig9lnINN2ol@news.umbc.edu>
  9.     <1ii4jvINNn85@early-bird.think.com>
  10. Sender: news@reed.edu (USENET News System)
  11. Organization: Stonehenge Consulting Services; Portland, Oregon, USA
  12. Lines: 12
  13. In-Reply-To: barmar@think.com's message of 7 Jan 1993 20:42:39 GMT
  14.  
  15. >>>>> In article <1ii4jvINNn85@early-bird.think.com>, barmar@think.com (Barry Margolin) writes:
  16. Barry> grep "^[A-Z0-9][A-Z0-9][A-Z0-9]  [0-9][0-9][0-9][0-9][0-9]" infile > outfile
  17.  
  18. Or using Perl's curly-brace multipliers:
  19.  
  20. perl -ne 'print if /^[A-Z0-9]{3} [0-9]{5}/' infile >outfile
  21.  
  22. Just another Perl hacker,
  23. --
  24. Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
  25. merlyn@ora.com (semi-permanent) merlyn@reed.edu (for newsreading only)
  26. factoid: "Portland, Oregon, home of the California Raisins and Lone-Star Beer!"
  27.