I have an XML file and I would like to replace everything that is between the open and closing tag within multiple instances of the g:gtin node with nothing.Is this possible from the command line, using sed or something similar?<g:gtin>31806831001</g:gtin>
regex replace text in xml file within node from the command line
command line;sed;regular expression;replace;xml
A simple solution for simple cases - see my comment:echo <g:gtin>31806831001</g:gtin> | sed 's|<g:gtin>.*</g:gtin>|<g:gtin></g:gtin>|'Result:<g:gtin></g:gtin>It depends on the assumption that start and endtag are on the same line, and not more than one tag is on that line. Since xml files are often generated the same way, over and over again, the assumption might hold. 