Timeline for How can I escape special characters in a sed "sub-command"?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:40 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Mar 12, 2016 at 1:25 | comment | added | cas | +1. This is the correct answer and should not have been downvoted. sed (or any regexp-based extraction) is not the right tool for parsing or extracting structured data like XML. grepping out a single line from an XML file...yeah, maybe...but XML files often don't have newlines, it's quite common for them to be a single line tens of thousands of characters long. | |
| Mar 11, 2016 at 16:27 | comment | added | Sobrique | You can almost certainly do the whole task using XML::Twig too in that case. It supports large source files, thanks to being able to purge or flush as you go. | |
| Mar 11, 2016 at 16:21 | comment | added | jktravis | Thanks, but I'm not using sed to parse the source. The sample file will be used in an XSLT as a test case with XSpec. But since the source document is very large, I explore the document using xmllint --shell and file the cases I want, save them, and then write my XSpec test cases. | |
| Mar 11, 2016 at 16:17 | history | answered | Sobrique | CC BY-SA 3.0 |