User login |
SedSed is a very useful program that often is used as a filter in shell scripts. From the sed man page: Sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).
Simple find-and-replace in text fileTo replace all occurrences of the string findme and replace it with the string replcaceme in a file named test.file using sed just use the follwing command.
Removing a complete XML element with bodyConsider the following XML formated addressbook. <?xml version="1.0" encoding="utf-8"?> <addressbook> <contact name="Bob"> <phone type="mobile" number="555 555 555" /> <address street="Lodge Hotell" city="Twin Peaks" /> </contact> <contact name="Alice"> <phone type="work" number="555 555 555" /> <address street="Queen Street 3" city="Wonder Land" /> </contact> </addressbook> Lets say we want to remove Bob from this addressbook.
|