grep question
Hi
Trying to grep a 2 gig file for email addresses. Have looked at using grep ".*\@[^ ]*[a-zA-Z0-9\-]*\.[a-zA-Z0-9\-]*" <file> but its not efficient. Can anyone help me on this? I also need to try and use sed or something to only display/copy out the email addresses themselves, not the junk either side. The file is basically a disk image, I used dd to dump it. Its my old ntfs vol which freaked out big time and I am working in Linux...good learning exercise! K |
Depends on the format and I'm not sure what would count as efficient - or how precise you need to be. This
Code:
grep '.*@.*\..*' html/bookmarks.html | sed 's/^.*mailto://g;s/\".*$//g' Why did you dump an NTFS volume into a disk image with dd? Or do I not want to know? :) |
create a sed statement searching for that string the most efficient I've seen is to actually use sed and grep together.
|
All times are GMT -5. The time now is 06:46 PM. |