![]() |
|
,
0 Comments
)
|
| Subject:
awk: extracting data
Category: Computers > Programming Asked by: milesw-ga List Price: $5.00 |
Posted:
07 Jun 2002 00:34 PDT
Expires: 14 Jun 2002 00:34 PDT Question ID: 23491 |
awk: extracting data Given a simple address book with poor formatting: john doe john@domain.com 555-111-1212 sally@domain.co.uk 555-555-1212 sally doe 515-1212 joe blow joe@domain.info jane doe jane@domain.com bob doe bob@domain.com etc... How can just the email addresses be extracted to a new file using awk alone? Please do not answer this question unless you have an answer that works using only awk. |
|
| Subject:
Re: awk: extracting data
Answered By: bookface-ga on 07 Jun 2002 01:15 PDT Rated: ![]() |
bash-2.03$ awk '
{
for(i=1;i<=NF;i++){
if($i ~ /@/){
print $i
}
}
}
' awktest
john@domain.com
sally@domain.co.uk
joe@domain.info
jane@domain.com
bob@domain.com
Thank you for using Google! Answers. | |
| |
milesw-ga
rated this answer:
Many, many thanks for the excellent answer and blazing fast response time. Also appreciated the extra information you kindly added in the clarification. |
|
| There are no comments at this time. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |