Difference between revisions of "Sed"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
If one needs to replace more than one set of characters, one can use the following expression: | If one needs to replace more than one set of characters, one can use the following expression: | ||
sed -e "/'/d" -e "s/,/|/g" OriginalTextualContent.txt > NoSeparator.txt | sed -e "/'/d" -e "s/,/|/g" OriginalTextualContent.txt > NoSeparator.txt | ||
Note the two <code>-e</code> prefixes. These prefixes defines the multiple substitution expressions. | |||
For more explainations, see<ref>{{:Video/Learning Sed Is Beneficial For Linux Users}}</ref> | For more explainations, see<ref>{{:Video/Learning Sed Is Beneficial For Linux Users}}</ref> | ||
Line 13: | Line 15: | ||
<noinclude> | <noinclude> | ||
=References= | =References= | ||
<references/> | <references/> |
Revision as of 01:36, 27 January 2022
sed is a unix command for stream data editor.
Special Characters
When dealing with special characters, use a different set of separators. For example: when dealing with '
, use the following command:
sed "/'/d" OriginalTextualContent.txt > NoSeparator.txt
Use two more more replacement rules
If one needs to replace more than one set of characters, one can use the following expression:
sed -e "/'/d" -e "s/,/|/g" OriginalTextualContent.txt > NoSeparator.txt
Note the two -e
prefixes. These prefixes defines the multiple substitution expressions.
For more explainations, see[1] Click here to see the portion that talks about special characters
References
- ↑ DistroTube, ed. (Jun 25, 2021). Learning Sed Is Beneficial For Linux Users. local page: DistroTube.