The key to xmlstarlet is xpath. Its the same thing you need to know to effectively use JQ. Or, with xmlstarlet, you can build a xslt file to make the transformation, then use xmlstarlet to marry the two in bash. Good luck Kevin On 1:30am, Wed, Sep 12, 2018 der.hans wrote: > Am 12. Sep, 2018 schwätzte Kevin Fries so: > > moin moin, > > I tried Xmlstarlet and it just wasn't working for me. > > I'll give it another go next time I need to do a transform. > > danke, > > der.hans > > > Xmlstarlet > > > > http://xmlstar.sourceforge.net > > > > Kevin > > > > > > > > ⁣Sent from BlueMail ​ > > > > On Sep 12, 2018, 12:48 AM, at 12:48 AM, "der.hans" > wrote: > >> moin moin, > >> > >> Actually, sgrep with sed for XML :). > >> > >> I have a chunk of XML I would like to transform. Any suggestions on how > >> to > >> do the following from the command line? > >> > >> ---- > >> > >> >> office:value-type="string"> > >> blah content stuff > >> > >> >> office:value-type="string"> > >> > >> > >> > >> > >> ---- > >> > >> I would like to make the first cell span 3 columns and wipe out the > >> second > >> cell. > >> > >> The graphical tool essentially turns it into the following. > >> > >> ---- > >> > >> >> table:number-columns-spanned="3" office:value-type="string"> > >> blah content stuff > >> > >> > >> > >> ---- > >> > >> A new style, Table1.A2, is introduced. That cell is spanned across > >> three > >> columnts. The table:table-cell object for the second cell is removed. > >> > >> I can do this with sed, but that invites XML issues. Also, there are > >> some > >> more complex changes I want to make. > >> > >> ciao, > >> > >> der.hans > >> -- > >> # https://www.LuftHans.com https://www.PhxLinux.org > >> # "Metrosexuals notwithstanding, quiche still lacks something." -- > >> David Brin > >> --------------------------------------------------- > >> PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org > >> To subscribe, unsubscribe, or to change your mail settings: > >> http://lists.phxlinux.org/mailman/listinfo/plug-discuss > > > > -- > # https://www.LuftHans.com https://www.PhxLinux.org > # "Dinosaurs return. Want their oil back." -- David > Brin--------------------------------------------------- > PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org > To subscribe, unsubscribe, or to change your mail settings: > http://lists.phxlinux.org/mailman/listinfo/plug-discuss