Retourner au contenu associé (entrée de forum : Shell script / parse XML, limites ?)
Posté par M.Poil (site web personnel) le 29 novembre 2013 à 08:51. En réponse au message Shell script / parse XML, limites ?. Évalué à 2.
Je parse souvent du XML avec awk, alors oui c'est crade mais c'est hyper rapide, exemple
awk -F"<|>|=" '{ if (0ドル ~ /Host name/) { host=3ドル } else if (0ドル ~ /ID/) { linehost=host";"4ドル } else if (0ドル ~ /title/) { linehost=linehost";"3ドル print linehost linehost="" } }' toto.xml root@game:~# sh toto.sh "192.168.1.2";"22344";Mine "192.168.1.2";"22301";Nope "192.168.1.2";"22899";Goog "192.168.1.4";"22111";M "192.168.1.4";"22864";Nope "192.168.1.4";"22800";Goog
Is it a Bird? Is it a Plane?? No, it's Super Poil !!!
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# awk
Posté par M.Poil (site web personnel) . En réponse au message Shell script / parse XML, limites ?. Évalué à 2.
Je parse souvent du XML avec awk, alors oui c'est crade mais c'est hyper rapide, exemple
Is it a Bird? Is it a Plane?? No, it's Super Poil !!!