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?
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?
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'); do
echo -e ".mode csv\nselect * from $i;" | sqlite3 "$SFILE" > "$i".csv
done
start 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...