Tag Info

New answers tagged

0

xml-cut from xml-coreutils may accomplish your needs


0

I think the follow should help. This is usual task which should to do between two limits. unset f t while read l do t=${t:+$t\\n}$l l=${l//[<>]/} : ${f:="$l"} if [ "$l" = "/$f" ] then echo -e "$t" > "$f".xml unset f t fi done < <(cat your_xml_file)


0

The application XMLStarlet appears to be available on OSX via brew, so you should be able to install it like so: $ brew install xmlstarlet Once it's installed, you use it via the command line via the command xmlstarlet. Usage $ xmlstarlet XMLStarlet Toolkit: Command line utilities for XML Usage: xmlstarlet [<options>] <command> ...


1

With xmllint using libxml version 20708: Name of root node "something": xmllint --xpath "name()" file.xml Text "lol": xmllint --xpath "//*/*/text()" file.xml Script sql.sh: #!/bin/bash file="$1" table=$(xmllint --xpath "name()" "$file") value=$(xmllint --xpath "//*/*/text()" "$file") cat << EOF INSERT INTO \`${table}\` VALUES (${value}) EOF ...


2

It looks like your output is in some way encoded. You can try to pipe the output from grep through sed, it that is the only sequence you have to change: echo 'AAA"& #x5c;"BBB"& #x5c;"CCC' | sed 's/"& #x5c;"/\//g' will give you AAA/BBB/CCC



Top 50 recent answers are included