Quotes in model titles break CSV Markup Wizard (recent change)

Discussion in 'Shapeways Shops' started by TinyMtn, Feb 2, 2014.

  1. TinyMtn
    TinyMtn Member
    I offer my models in a variety of different sizes, and it is well-known that Americans don't take well to metric measurements, so I indicate in all of my titles the size of the model, using the standard double-quote mark to indicate "inches."

    The CSV Markup Wizard has a problem with this, because the CSV file that I download has an unescaped double-quote mark inside the title string:
    Code:
    "854223","60","4" Zion National Park Terrain Model, Utah, USA","Frosted Detail",public,"15.8590","","42.9","USD","16.1"
    When I upload the same file that I download, this errant double-quote messes the columns up, and the incoming file is rejected.

    Until some time in January, I could get around this by modifying the .csv file and adding an escape mark before the "inches" double-quote:
    Code:
    "854223","60","4\" Zion National Park Terrain Model, Utah, USA","Frosted Detail",public,"15.8590","","42.9","USD","16.1"
    But now that doesn't work, and the uploader admonishes me for changing more than just the markup column.

    I've worked a lot with automatic processing of csv files with arbitrary strings in Python, and it's not fun. But, as it stands, I am unable to change prices, or add or remove models from my store until quotes in model titles can be treated correctly (by either the downloader or uploader), or I start forcing cm on my US clients.

    Can Shapeways either bring back the old CSV uploader, or have the downloader properly escape quotation marks in model titles?
     
  2. barkingdigger
    barkingdigger Well-Known Member
    Not sure about getting the CSV changed, but an obvious work-around is to use abbreviations instead of quotes.

    in (inches)
    ft (feet)
    yd (yards)
    mi (miles)

    Thus 18" becomes 18in, which shouldn't trip the CSV. As a "bilingual measuring" American I can vouch for them as being understood!
     
  3. TinyMtn
    TinyMtn Member
    I can't honestly say I like that idea. I'd have to change 150-ish models, and even "4in Grand Canyon" could mean something different. Why aren't there 5 in the Grand Canyon? It'd be nice if the CSV that the Wizard hands out would be accepted, unchanged, back into the system.
     
  4. Magic
    Magic Well-Known Member
    Mark,

    I haven't used the Markup file for a long time, but as far as I remember, when you upload the file again only 2 columns are mandatory: the Model ID and the Markup ones. So you can delete the Title column and it should work fine.
    Can you test that?
     
  5. TinyMtn
    TinyMtn Member
    I will try removing the item title and leaving the commas, though I suspect that the uploader will complain that I changed the file (it seems more picky about that now).

    Everyone smarter than me is using the Python API. Maybe I should just invest the time to figure that out.
     
  6. stonysmith
    stonysmith Well-Known Member Moderator
    You'll need at least ModelId, MaterialId, and Markup.

    edit:
    It's best to leave the column headers in place as they were..
    If you just make the Model Title column blank, it'll work fine.
     
    Last edited: Feb 4, 2014
  7. TinyMtn
    TinyMtn Member
    I'll give that a shot tonight. Thank you.
     
  8. TinyMtn
    TinyMtn Member
    The CSV file that I receive began like this
    Code:
    model_id,material_id,model_title,material_title,view_state,volume,shop_section,price,currency,markup
    "854223","6","4" Zion National Park Terrain Model, Utah, USA","White Strong & Flexible",public,[pricing stuff]
    ...
    and this is what I uploaded
    Code:
    model_id,material_id,model_title,material_title,view_state,volume,shop_section,price,currency,markup
    "854223","6",,"White Strong & Flexible",public,[pricing stuff]
    ...
    And this is what comes back
    Screenshot02042014.png

    Something changed in the last month that broke this. I'd be happy to know if that could be rolled back, or when I could expect to use the site again.
     
  9. TinyMtn
    TinyMtn Member
    Any chance I can have some clarification about this issue? The shop changes are stacking up, and I'd like to know if I should start the lengthy task of working around this (and dealing with all the broken links that 100+ model title changes will create).
     
  10. stonysmith
    stonysmith Well-Known Member Moderator
    Sorry.. out of town last week and missed your message. Instead of the two commas for the empty name, try putting ...,"",... or even ...,"A",...
    The uploader (at this time) won't change your model names, but it does seem to be picking about HAVING a name.
     
  11. TinyMtn
    TinyMtn Member
    No worries! Glad to hear from you. I'm sorry to report, though, that both of those tests give the same "Error in Upload" result. I even tried "unix2dos"'ing the file, to no avail.
     
  12. TinyMtn
    TinyMtn Member
    Is there a place to submit a bug report? I am still dead in the water here, save going back and changing titles for 100+ models. Even if the word is "We won't fix it", I'd be happier knowing that. Thanks again to readers and coders.
     
  13. stannum
    stannum Well-Known Member
    Bug reports section.
     
  14. TinyMtn
    TinyMtn Member
    I feel a little stupid for not scrolling down that far. I am used to reporter-unfriendly bug tracking systems. Thank you. =0/
     
  15. stonysmith
    stonysmith Well-Known Member Moderator
    I just realized there is another workaround possible.. use two apostrophes ('') looks a lot like (") and won't break the CSV system
    I recognize that would require a lot of work to fix all the model titles, but it would circumvent the problem for now.

    Also, just in case you weren't aware.. you can delete ROWS of the csv without hurting anything. Rows that you delete simply won't make any updates when you upload the file. (the logical extension of this is that you could update the markup on just ONE model at a time)
     
  16. TinyMtn
    TinyMtn Member
    That's working. It looks almost exactly the same, and lets me add and modify all the new pieces. I'm back in business. But I've also started to work on using Python instead of Perl to automate the builds and pricing.
     
  17. stonysmith
    stonysmith Well-Known Member Moderator
    Sweet! If you need some Python help, let me know.. I've been working a bit lately with the API myself.