my net house

WAHEGURU….!

Stream editor commands

Played with srtream files for various things to be played:

sed -i s/<search-teaxt>/<replace with> filename

#when removing forward slashes from file:

sed -i /\\/// filename # we don’t have to replce anything so we  are not writing it.

#put inverted comma in each line

#put inverted comma in each line
sed 's/.*/"&"/'



#without spaces
sed 's/ *\(.*\) *$/"\1"/'
#skip empty lines

sed 's/ *\(.*\) *$/"\1"/'












Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: