にXML callistを復元し、私は今、私はcsvファイルには、このフォーマットからcallistをエクスポートしようコールログのバックアップを変換&CSV
echo '<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!--File Created By Call Logs Backup & Restore v3.70 on 23/12/2016 03:02:21-->
<?xml-stylesheet type="text/xsl" href="calls.xsl"?>
<calls count="500">
'>all.xml
for i in calls-*.xml; do head -n-1 "$i"|tail -n+5; done>>all.xml
echo "</calls>">>all.xml
ですべての私のコールファイルから一つの大きなファイルall.xml
を作成:
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<!--File Created By Call Logs Backup & Restore v3.70 on 23/12/2016 03:02:21-->
<?xml-stylesheet type="text/xsl" href="calls.xsl"?>
<calls>
<call number="+492345678" duration="0" date="1426694707547" type="3" readable_date="18.03.2015 17:05:07" contact_name="Someone" />
<call number="+492345679" duration="3" date="1426695646292" type="2" readable_date="18.03.2015 17:20:46" contact_name="Someone else" />
<call number="+492345670" duration="0" date="1426695687556" type="2" readable_date="18.03.2015 17:21:27" contact_name="Someone" />
</calls>
は私がxmlstarlet
で試してみました:
xmlstarlet sel -B -t -m "//calls/call" -n -m "*" -v . -o , all.xml |less
が、それは私だけを与えますそれぞれの呼び出しに値がないので、各呼び出し要素のオプションに空のリストがあると思います。
私は助けを借りて見つけられませんmanuals, I found どのようにオプションをCSVで入手できますか?
クールで、私はコンカットの ''\"' 'で引用符を追加しました – rubo77