SvenWerlen / fvtt-data-toolbox

Foundry VTT Data Toolbox
https://www.patreon.com/moulinette
22 stars 8 forks source link

JSON errors due to expanded CSV(?) #1

Closed Ironxxx closed 4 years ago

Ironxxx commented 4 years ago

Not really an issue but more trying to understand how this works. I've been attempting to import creatures but constantly get various JSON errors, even with the simplest JSON. I've just realised it's probably because I've added a lot of columns to the CSV file (to break up skills mainly which I've done for the whole D20PFSRD data). Does the Data Toolbox rely on the CSV file being in the exact structure that you present it in the sample? Or can it be expanded?

SvenWerlen commented 4 years ago

Hi, CSV file is never an issue. Most of the time, it's the generated JSON that is not valid. Often, I strip part of the JSON but keep a "," at the end of a list which makes it invalid. The CSV doesn't have to match the structure. If you use Discord, you can contact me directly (Dorgendubal#3348). If you can provide me an example (data + template), I can investigate. Thanks for helping me making the tool better!

SvenWerlen commented 4 years ago

Version 0.2.0 improves error handling and provides useful information in the console in order to find which row/column contain invalid data (ex: text mixed with number). It also converts empty into 0 for fields of type number.