BlitzKraig / fvtt-EasyTable

Super simple CSV to rollable table creator for Foundry VTT
MIT License
15 stars 20 forks source link

problems parsing CSV: quotes not stripped, embedded commas not ignored, extra blank entry #10

Closed wmve closed 3 years ago

wmve commented 3 years ago

steps to reproduce:

  1. click CSV to Table
  2. enter table name
  3. enter "Wyverns, Wyrms, Drakes & Dragons: The Differences", into CSV Data image
  4. click Generate

expected result: table with one result: Wyverns, Wyrms, Drakes & Dragons: The Differences actual result: image

notes:

i also note, from my dozen+ attempts to get something to import, that your use of the term "CSV" was very confusing to me. i don't think you implemented the commonly understood meaning of "CSV" for your input. i could not figure out what the record separator was. once i guessed that you don't have a record separator, based on the only example you had, things started making a bit more sense. also, things became more understandable once i dropped my assumptions that what you meant by "CSV" was what others in the software wrold means when they use that term. i'm guessing you were just trying to get something simple working to create tables--you are offering a feature that foundry sorely needs!--but i would avoid using the term "CSV" in any of your text as that has much meaning attached to it that i'm guessing you aren't implementing.

anyway, i hope you are interested in enhancing your module to produce the expected behaviour above. if you need help with regular expressions to parse the data let me know. i've been doing it for decades and could save you some time and headaches there. i just don't know how to write foundry addons (yet).

wmve commented 3 years ago

image

BlitzKraig commented 3 years ago

In order to use data with commas in the entries, you can change the Separator to another character. (Vertical pipe for example)

Thanks for the feedback, I'll consider it.

BlitzKraig commented 3 years ago

I have renamed occurences of CSV to Values in order to prevent confusion.

I have no interest currently in improving the parsing to strip quotes etc., and the separator character can easily be changed to accomodate values with commas. This project is open-source however, and you are free to put up a PR if you are interested in making these changes. It's a very simple thrown-together project, so it shouldn't be too difficult to work out how to change the import and export logic.

I do however agree that the use of CSV could cause confusion: the default setup is for values which are separated by commas, but CSV as an acronym carries some extra weight.

Thanks for the feedback, changes will release in the next update.