View Full Version : CSV to Table Importer Help
Stargrove
March 6th, 2025, 00:13
I created my own CSV to Table importer extension for my work as a community developer. It works fine when I import tables into Story entries. However, I have been having trouble getting it to work properly/reliably when trying to import tables into Reference Manual Story(Advanced) entries . I kind of gave up on it and have been just creating a regular Story entry, import the table into it and then cut and paste it into the Reference Manual entry (Story(Advanced)).
I am hoping someone who understands this all better than I can help me out. Here is the link to the repository where I am keeping it:
https://github.com/Stargrove528/CSV2Table
Thanks
Trenloe
March 6th, 2025, 15:17
What's the exact issue you're having? Where is it failing?
LordEntrails
March 6th, 2025, 21:14
Their already one on the Forge, Mattekures's? I think, that I've been using. It too won't import to Advanced Story Pages, so what I do is import to a basic story and then cut and paste into the Adv Story. Works just fine, though it is an extra step.
The Basic and Advanced stories have very different xml formats and element names. Have you looked that your code is accounting for this?
Stargrove
March 6th, 2025, 23:13
What's the exact issue you're having? Where is it failing?
Their already one on the Forge, Mattekures's? I think, that I've been using. It too won't import to Advanced Story Pages, so what I do is import to a basic story and then cut and paste into the Adv Story. Works just fine, though it is an extra step.
The Basic and Advanced stories have very different xml formats and element names. Have you looked that your code is accounting for this?
Yes, I had used Mattekures in the past, but wanted one that could work with the Advanced Stories so I made one of my own to help with conversion workflow. I know its not that many extra steps and this was just an exercise to see if I could do it. I am not a the best coder and still trying to better understand LUA.
The code has commented out lines that, if uncommented, tell me in the chat that it has found the #table# in the Advanced Story when I create it, but I am having trouble trying to get the table inserted into it properly when I try and import it.
Trenloe
March 7th, 2025, 00:26
The code has commented out lines that, if uncommented, tell me in the chat that it has found the #table# in the Advanced Story when I create it, but I am having trouble trying to get the table inserted into it properly when I try and import it.
I've tested this in all of the different advanced story text entry types within the Campaign reference manual (see screenshot below). If you have a set of test data that reliably fails, then please provide it. Otherwise, I'd recommend adding in extra logging lines to the code to see what's being returned - especially for cFormattedText.getValue() and newValue in the onCSVFileSelection function, and see if that helps you narrow it down.
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=63712
Stargrove
March 7th, 2025, 18:59
I've tested this in all of the different advanced story text entry types within the Campaign reference manual (see screenshot below). If you have a set of test data that reliably fails, then please provide it. Otherwise, I'd recommend adding in extra logging lines to the code to see what's being returned - especially for cFormattedText.getValue() and newValue in the onCSVFileSelection function, and see if that helps you narrow it down.
This is frustrating. My testing last night and today shows the same thing...that is it working...~~sigh~~ When I was converting the last module I was working on I was not having any luck with my extension putting tables into he Advanced Story entries and did not want to stop working on the conversion and so was just copying and pasting from a temp Story entry. That was several weeks ago now. I appreciate you taking a look at it Trenloe. I wonder if the problems start after there are a lot more entries for the extension to comb through.
I will keep testing it out as I am starting a new book conversion this weekend and see if I run into any issues. If I find any I will try and post for more help if I can't sort it out.
ddavison
March 7th, 2025, 19:21
The formatted text fields also recognize basic HTML tables with colspan="X' values and the old PAR5E table format. Just right click and choose the Clean Up Text wizard.
Zacchaeus
March 7th, 2025, 20:31
Video forty six here might help with importing text; it goes over the html and par5e tags that you can use to create tables with the text clean up tool https://www.fantasygrounds.com/forums/showthread.php?55797-How-do-I-in-Unity
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.