Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing phone numbers from a file

Status
Not open for further replies.

ianicr

IS-IT--Management
Nov 4, 2003
230
GB
Has anyone got any ideas how I can get phone numbers out of a file? The file in question is a complete mess! fields all over the place etc.. Is there a way to just take out the phone numbers a put them into a newline seperated file?
eg.
02081234567
01422486789

Thanks
 
This will extract 11-digit numbers...

awk 'match($0,"[0-9]{11}"){print substr($0,RSTART,RLENGTH)}' $FILE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top