Recent Changes - Search:

Softwares

.

Sed-stream-editor

Main.Sed-stream-editor History

Hide minor edits - Show changes to output

August 24, 2012, at 10:41 AM by 101.62.104.194 -
Added lines 72-73:
(:Googlemm:)
Deleted line 84:
(:Googlemm:)
August 18, 2012, at 01:11 AM by 101.63.233.90 -
Added lines 8-9:
(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
Changed lines 13-14 from:
to:
(:tableend:)
Added lines 17-18:
(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
Changed lines 22-25 from:
to:
(:tableend:)

Added lines 29-30:
(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
Deleted line 35:
Changed lines 37-38 from:
to:
(:tableend:)
Added lines 45-48:
*To delete any line containing the word "yourword" from the file "yourfile":

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
Deleted lines 49-50:
To delete any line containing the word "yourword" from the file "yourfile":
Deleted lines 50-61:

To delete all instances of the word "yourword":

sed 's/yourword//g' yourfile

To delete two words from a file simultaneously:

sed -e 's/firstword//g' -e 's/secondword//g' yourfile

or

sed 's/firstword//g;s/secondword//g' yourfile
Added lines 52-83:
(:tableend:)

*To delete all instances of the word "yourword":

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
[@
sed 's/yourword//g' yourfile@]
(:tableend:)


*To delete two words from a file simultaneously:

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
[@
sed -e 's/firstword//g' -e 's/secondword//g' yourfile
@]
(:tableend:)

or

(:table border=1 width=50% bgcolor=yellow cellspacing=0 :)
(:cellnr:)
[@
sed 's/firstword//g;s/secondword//g' yourfile

@]
(:tableend:)

----
(:Googlemm:)
August 17, 2012, at 08:25 AM by 15.211.153.75 -
Changed lines 22-26 from:
sed -e '/^ *$/d' inputFileName
to:
$ sed -e '/^ *$/d' p
33
33
33
August 17, 2012, at 08:19 AM by 15.211.153.75 -
Added lines 30-47:

[@
To delete any line containing the word "yourword" from the file "yourfile":

sed '/yourword/d' yourfile

To delete all instances of the word "yourword":

sed 's/yourword//g' yourfile

To delete two words from a file simultaneously:

sed -e 's/firstword//g' -e 's/secondword//g' yourfile

or

sed 's/firstword//g;s/secondword//g' yourfile
@]
August 17, 2012, at 06:10 AM by 15.211.153.75 -
Changed lines 6-7 from:
* Note: "sed -i" overwrites the original file with a new one.
*
to:
* Note: "sed -i" overwrites the original file with a new one.

[@
$ sed -i 's/123/222/' p
@]

* -e option indicates that the sed expression follows:

[@
sed -e 's/oldstuff/newstuff/g' inputFileName > outputFileName
@]

* The s stands for substitute. The g stands for global.
* The d command to delete lines that are either blank or only contain spaces:

[@
sed -e '/^ *$/d' inputFileName
@]

!!Regular expression metacharacters:

*The caret (^) matches the beginning of the line.
*The dollar sign ($) matches the end of the line.
*The asterisk (*) matches zero or more occurrences of the previous character.
August 17, 2012, at 04:47 AM by 15.211.153.75 -
Added lines 1-7:
(:Google1:)
(:Googletxt:)
----

* sed (stream editor) is a Unix utility that parses text.
* Note: "sed -i" overwrites the original file with a new one.
*
Edit - History - Print - Recent Changes - Search
Page last modified on August 24, 2012, at 10:41 AM