Skip to main content

Thread: sed replace string of line


hi,

have file lots of lines that

code:
randomstring | randomstring
and want remove until "|".

ideas how sed/awk?

tia!

been while, not it?

test.txt:
code:
randomstring | randomstring randomstring | randomstring randomstring | randomstring randomstring | randomstring randomstring | randomstring
code:
$ sed 's/.*\(|.*\)/\1/g' test.txt  | randomstring | randomstring | randomstring | randomstring | randomstring
i'm little forgetful on head twisting hieroglyphs of sed though

[edit] but
sed -i 's/.*\(|.*\)/\1/g' test.txt
'in place' editing


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk sed replace string of line


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support