The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-22-2008
mcW mcW is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 19
sed-question delete everthing after a couple of numbers

Hi,

I've a textfile with a lots of numbers. After some numbers are comments.
I want delete these comments with sed, but dont know the correct pattern.

for example (my textfile):
PHP Code:
3202 mycomment
292
-is way to low
1
#correct
3  #my whitespace comment
4229 // comment
20.201 // numbers with dots are also in my file
202.02 miaumiau
1.234.99 
''''''FOO 
So I want to delete ALL stuff after ne last number ...

correct ouput:
PHP Code:
3202
292
1
3
4229
20.201
202.02
1.234.99