Hey, Scott.  If you'd like, send me a sample off-list.  I could use a short
brain teaser this morning.

The general idea I think would be to do a grep and only look for lines with
well-formed IP addresses.

e.g. egrep "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" sample.txt
>result.txt

[0-9] means match any number 0 to 9 inclusive
{1,3} means match the preceeding expressive between 1 and 3 times
\. means use the \ to escape the . character which otherwise has special
meaning in regexp

There are probably better ways to look for well formed IP addresses, because
this would allow for a string like: 999.444.1.444

Andrew 8)

-----Original Message-----
From: Scott Fisher [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 16, 2004 8:13 AM
To: [EMAIL PROTECTED]
Subject: [Declude.JunkMail] OT: Grep out letters


I have a file IP numbers and some rare entries with letters.

I'd like to use grep to remove anything that has letters in it.

Can anyone help me out?

Scott Fisher
Director of IT
Farm Progress Companies

---
[This E-mail was scanned for viruses by Declude Virus
(http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.
---
[This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.

Reply via email to