POCKETEARTH

Importing CSVs broken, for me

Home All Topics Bugs Importing CSVs broken, for me

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4150
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    This is probably a problem of mine. But I will record it in case it’s not!

    I am trying to add CSVs from http://www.megalithic.co.uk/topics.php?countries=1&kmldown=1 to my PE. In the past, I have been able to use Safari on my iPad 2 (iOS 6.1.3) to “open” CSVs from that site, and Import them to PE 1.6.3. Now I can not do that; nor can I save them to my computer hard drive and add them to iTunes and Import from there. Get a message stating “Error, Failed to import the selected file.”

    I also tried importing same from iTunes on hard drive into PE Beta 1.6.2, no luck!

    I am able to Import from Safari when I “open” a GPX from http://www.randogps.net/ and save it to PE.

    No idea what’s going on! Sorry!

    #4786
    GeoMagik
    Admin
    • Topics: 32
    • Replies: 799

    CSV is a very generic format, not at all specific to map Pin or POI data. This means that the CSV file must have easily identifiable column headers to know how to interpret the data.  The first row (header row) of the CSV file must have the following names:

    Required (1 of following):
     • lat/latitude AND lon/long/longitude:  to specify location in separated lat/lon coordinates
     • loc/location: to specify location in any of our supported coordinate strings (see Help Manual for full list of supported formats)
    Optional:
     • name: name of pin 
     • notes: notes stored on pin
     • icon: type of icon – this may be any one of the following values (corresponding to the 10 icons offered on the Pin Detail screen):
        • marker-pin
        • marker-pin-small
        • marker-pin-flag
        • marker-pin-home
        • marker-pin-contact
        • marker-pin-camera
        • marker-pin-sleep
        • marker-pin-food
        • marker-pin-footprint
        • marker-pin-star
     • color: color of icon – may be any CSS color name (red, green, purple, etc)  or hex color code (#FFFFFF)
     • address: address stored on pin
    All other headers/columns are ignored.
    The CSV files you linked have there own header naming scheme, so you will have to edit the CSV file to change the headers to what I described.
    [Edit]:  Additionally the CSV file should be saved in standard comma separated, quoted fields in UTF-8 format with Unix Line Endings (LF).  All modern software should use these settings by default, but if you are using an older version of Excel on Windows, you may need to change this when saving/exporting the file from Excel.

    #4774
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    Thank you for your prompt help!

    I was confused, because I thought I had downloaded and imported CSVs from this site before. Then I noticed that I was not getting all the available sites/pins, and went back to the administrators. They worked on some scripts and now I have to replace all the CSVs with new ones. OK, but, the new ones didn’t work.

    However, I think what’s happened is that, before, I was actually importing GPX files. And those files had “headers” that matched the PE-expected headers. But these furshlugginer CSVs have crazy headers! NOW I see.

    OK, I’m slogging through the CSVs, fixing the headers (which, if that were the only problem, I could do at one whack with a text editor) but also creating a new notes field that will concatenate some of the other columns into a PE readable form.

    Oh brother! The things we go through for our maps!

    Thank you for your patient help. You are the best.

    #4775
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    Holy Moses! Has this been a learning experience?

    1. Apache Open Office refused to stop Auto-correcting my icon field from marker-pin-small to Marker-pin-small, and PE refused to recognize the latter. So, on to Filemaker Pro…

    2. In FMP, it was easy to create auto-data-entering icon and color fields, and a concatenating field to merge and munge five other fields into a Notes field, for example:

    Rock Art. Condition: 2; ambience: 0; access: 0.

    http://www.megalithic.co.uk/article.php?sid=33425

    However, I still had to apply a grep-based find/change to the exported CSVs so the FMP soft-returns became true line feeds. Luckily I remembered how to do that!

    And, totally luckily, my FMP-exported CSVs were all double-quote escaped, and PE seems to be honoring the escaping, and preserving the line feeds in the Notes field. Marvelous.

    #5255
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    Just in case anyone else ever searches out this thread on CSVs, I add one more little caveat.

    My latest home-made FMP CSVs would not Import. It took me an hour of fiddling around to figure that for some unknown reason, My record delineating “paragraph returns” were Macintosh Carriage Returns, whereas PE wants Linux Line Feeds. Good lord!

    So if you’re having problems importing a CSV, that would be one thing to check.

    #5288
    GeoMagik
    Admin
    • Topics: 32
    • Replies: 799

    @BuckyE:

    Thanks for reporting that! I have updated my comment above, and we will add better support in our next app update for importing CSV files with alternate Line Endings and UTF formats.
    #5290
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    My pleasure. I wonder how many users would run across these problems? I seem to be the collector of oddball circumstances!

    #7622
    nounours
    Moderator
    • Topics: 66
    • Replies: 260

    Hi there!

    I finally managed to do import!!!! Two things that were wrong:

    1) I added the degree (°) sign after the coordinates (as in the export .csv), but it was obviously differently encoded. Removing it helped!

    2) Due to my regional settings, the .csv files are exported using semicolon (;), instead of comma (,) which seems to be required.

    Fixing these two things helped.

    thanks, nounours

    #7626
    BuckyE
    Moderator
    • Topics: 63
    • Replies: 299

    Dear nounours,

    Congratulations! Looks like you’re another Problem Finder and Fixer.

    Yes, I assume a semicolon-instead-of-a-comma would wreck a Comma Separated Values (CSV = .csv) file!

    Having to escape punctuation in CSV files is kind of a pain, but it’s handy being able to write and Import simple files without the GPX formatting. Which I don’t understand at all!

    #7631
    nounours
    Moderator
    • Topics: 66
    • Replies: 260

    yes. But until now I always had the opinion that a .csv is normally separated with “;”, but “,” is equally valid.
    It looks strange to me not to accept a semicolon …

    n.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Geomagik LLC


Contact Us

If you have any questions, comments or suggestions, we'd love to hear them!
Please fill out the form below or post to our Forum.

    PocketEarth © 2012 GeoMagik LLC. All rights reserved. Apple, the Apple logo, iPod, and iTunes are trademarks of Apple Inc., registered in the U.S. and other countries. iPhone is a trademark of Apple Inc.