[TriLUG] OT: Query/edit XML file

Matthew Opoka matthew at opoka.name
Mon Apr 20 14:00:00 EDT 2009


My application dumps a rather large XML file with DTD headers and I need to query(regex) and edit the file so it can be re-imported.  Does anyone know the easiest and best way to accomplish this task other than with vi line by line?
The query would be something like this:
Search for objects with type=hosts and name=hostname and value=HOSTA  where hostname only has one value.  If found, then add a new lower case variation(hosta) value and update the object action from declared to updated.   


Regards,

Matthew


      



More information about the TriLUG mailing list