GPSbabel convert from gpx file to csv file Can't get all elements of waypoints to be converted

Discussion in 'GPS Software' started by rick p, Nov 22, 2015.

  1. rick p

    rick p

    Joined:
    Nov 22, 2015
    Messages:
    2
    Likes Received:
    0
    New to mapping and trying to convert my downloaded garman.gpx file to .csv file. Intend to use csv to upload to my mapping database.

    My GPSbabel Code:

    gpsbabel -w -i gpx -f "waypts.gpx" -o csv -F "waypts.csv"

    The typical <wpt> tag in the gpx file contains:

    <wpt lat="48.230667952" lon="-116.548649501">
    <ele>630.505615</ele>
    <name>010</name>
    <cmt>15-DEC-13 4:22:27PM</cmt>
    <desc>15-DEC-13 4:22:27PM</desc>
    <sym>Flag, Blue</sym>
    </wpt>

    The conversion as code above produces:

    48.23067, -116.54865, 15-DEC-13 4:22:27PM
    48.23080, -116.54843, 15-DEC-13 4:33:22PM
    48.23080, -116.54843, 15-DEC-13 4:33:31PM

    How can I get all the <wpt> elements (7) from the file for each waypoint??

    Thanks for your help in advance

    R.
     
    rick p, Nov 22, 2015
    #1
  2. rick p

    Nuvi-Nebie Moderator

    Joined:
    Aug 16, 2015
    Messages:
    2,449
    Likes Received:
    209
    Location:
    UK
    Are you using a GUI front end for GPSbabel like gpsbabel-GUI.exe or actually running GPSbabel from a command line?
     
    Nuvi-Nebie, Nov 22, 2015
    #2
  3. rick p

    Nuvi-Nebie Moderator

    Joined:
    Aug 16, 2015
    Messages:
    2,449
    Likes Received:
    209
    Location:
    UK
    I have done a bit more digging, I have only just become aware of the different versions of CSV available using GPSbabel, I think that output type CSV may always only contain 3 fields rather than the 7 you require, however there are two other output formats you can use one is called UNICSV which gives a first line header e.g. Latitude, Longitude, Description. The other output option is called XCSV, this format can use a stile file that describes input and output fields, the example I saw showed 8 output fields so it may be possible to use XCSV to do what you want, there are links to some info. below :-

    http://www.gpsbabel.org/htmldoc-development/fmt_xcsv.html

    http://www.gpsbabel.org/htmldoc-development/style_examples.html

    also

    http://www.gpsbabel.org/htmldoc-development/fmt_unicsv.html
     
    Nuvi-Nebie, Nov 22, 2015
    #3
  4. rick p

    rick p

    Joined:
    Nov 22, 2015
    Messages:
    2
    Likes Received:
    0
    Thanks very much Nuvi-Nebie,

    The unicsv format works fine and retrieves all 7 elements.

    gpsbabel -i gpx -f file1.gpx -o unicsv,format=y -F result.csv

    I'll play around with the formats available other than format=y.
     
    rick p, Nov 23, 2015
    #4
  5. rick p

    Nuvi-Nebie Moderator

    Joined:
    Aug 16, 2015
    Messages:
    2,449
    Likes Received:
    209
    Location:
    UK
    Nuvi-Nebie, Nov 23, 2015
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.