Re: Processing element sets
Neil Clifford (n.clifford@physics.oxford.ac.uk)
Tue, 30 Jul 1996 11:53:11 +0100 (BST)
Allen Thomson scribbles:
|> If you you're running UNIX or have a UNIXlike set of utilities,
|>
|>grep '^[12] [012][0-9]' mailfile > elefile
|>
|>will extract the two-line elements pretty well.
Ok while we are talking unix, let's talk perl (though perl is available
for other [lesser :-)] OSs too). I use cgrep a context grep tool. With
it you can search for a given string and display its context - eg search
on a NORAD number and display the line above and below it:
bash% cgrep -1,1 16609U pub/sat/mirrors/molc/new_molc
Mir Complex 32.7 4.2 0.0 3.4
1 16609U 86017 A 96207.38876011 .00001178 00000-0 13405-4 0 6016
2 16609 51.6500 291.6915 0010535 342.4066 17.6436 15.61532273595947
I'll put it at ftp://ftp.physics.ox.ac.uk/pub/sat/programs/source/cgrep
(A GPLed perl script with instructions for use embedded).
regards,
--
Neil Clifford <n.clifford@physics.oxford.ac.uk>
http://www.physics.ox.ac.uk/sat/satintro.html