On Sun Dec 09, 2018 at 03:16:15PM -0700, Winfried wrote:
> Good call, thank you.
> 
> For others' benefit:
> 
> 1. Copy the file, open the copy in a text editor, use a regex to turn the
> data into tab-separated columns

If you are running some kind of unix-like environment this is something
Perl can be quite useful for:

    grep '^<wpt' source.gpx | perl -p -E \
       's!<wpt lat="(.*)" lon="(.*)"><name>(.*)</name></wpt>!$1\t$2\t$3!' \
       > waypoints.tsv

> 2. Create a new file, and create the table:
> sqlite3 waypoints.sqlite
> 
> sqlite> CREATE TABLE waypoints (name text, latitude text, longitude text, id
> INTEGER PRIMARY KEY);
> 
> 3. Import data:
> sqlite> .separator "\t"
> sqlite> .import waypoints.tsv waypoints
> select * from waypoints where id=1;

-- 
Mark Lawrence
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to