Add Comment

You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.

To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.

This is the comment you were replying to, attached to the weblog Sed advice


Re: Sed advice
Posted by busfault (69.205.xx.xx) on Thu 15 Feb 2007 at 15:05
I know you are using sed but this could be also easily done using grep
grep -o "[0-9]\{7\}"

pyrrhic@Valhalla:~$ cat sedtest
asdasdfasdfasdf1234567dsdgfdsgf2345671dsfgsdfgsdfg3456712sdfgsdfgdsfg

pyrrhic@Valhalla:~$ cat sedtest |grep -o "[0-9]\{7\}"
1234567
2345671
3456712

adding a |head -1 would give you the first result.

Username:Anonymous
Title:
Your Comment:

Posting Format:

 

Inappropriate comments will be removed.

Some help on entry formatting is available

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search