Replacing Part of Text Using Sed

Posted by neversaint on Stack Overflow See other posts from Stack Overflow or by neversaint
Published on 2010-04-12T01:00:53Z Indexed on 2010/04/12 1:03 UTC
Read the original article Hit count: 380

Filed under:
|
|
|

I have the following text file

Eif2ak1.aSep07
Eif2ak1.aSep07
LOC100042862.aSep07-unspliced
NADH5_C.0.aSep07-unspliced
LOC100042862.aSep07-unspliced
NADH5_C.0.aSep07-unspliced

What I want to do is to remove all the text starting from period (.) to the end. But why this command doesn't do it?

sed 's/\.*//g' myfile.txt

What's the right way to do it?

© Stack Overflow or respective owner

Related posts about sed

Related posts about linux