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