Convert Sqlite Database To Xml
Is there any way to convert a .sqlite file to XML? There exist tools that convert from XML to SQLite, but does are there tools that convert the other way, too?
Solution 1:
After some experimentation, I found a converter solution using sqlite3:
#!/bin/bash
SFILE="$1"
[ ! -f "$SFILE" ] && echo"$SFILE doesn't exist" 2>&1 && exit 2
for i in $(sqlite3 "$SFILE"'.table'); doecho -e ".mode csv\nselect * from $i;" | sqlite3 "$SFILE" > "$i".csv
donestart the script with ./script database.sqlite
Creates for each table via sqlite3 database.sqlite '.table' a tableentry.csv file.
Now to convert csv to xml...
Post a Comment for "Convert Sqlite Database To Xml"