I've been working on a framework and wanted to keep the data organized in excel. So I needed a way to quickly copy and paste tabular data into a json on a token. I figured I'd make the solution generic so you all could benefit from it.
Excel by default tab delimits the data and uses newlines to separate rows. You should have a final newline automatically from excel when you paste. Do not delete that newline as it can cause data loss.
Basically you select your table in excel. Copy. Paste it into the dialog. If your data has headers (or not) make sure the box is checked appropriately. You can select which token name you want the table to be placed as well as the variable name.
When you import data with headers it'll make a json array where each row's data has keys. Without headers you get an array of arrays.
Also I added a XLI.table() funciton similar to the table() function. For data without headers and leading with numbers. Its fairly easy to use I made most of the parameters except the table name optional.
XLI.table(string tableName, <int vlookup, string tableLocation>);
if you don't give it a vlookup it'll find the biggest number X in your keys and roll 1dX on the table, sort of like the regular table function. If you don't give it a location it will use currentToken().
Basically you can import properly formatted tables from excel and roll against them easily. The function returns that row's json with your roll substituted for the key.
Example: Below is a table for rolling random colors.
Interpreted as <=10 Red, 11-25 Blue, <=100 Orange
10 Red
25 Blue
100 Orange
XLI.table("XLI_table",1d100, "Lib: XLImport")
Output: [30,"Orange"]
XLI.table("XLI_table",-5, "Lib: XLImport")
Output: [-5,"Red"]
Let me know if you have any issues.
Enjoy!
[Drop-In] Excel Import
Moderators: dorpond, trevor, Azhrei, Gamerdude
[Drop-In] Excel Import
- Attachments
-
- Lib_XLImport.rptok
- Library Token v1
- (21.45 KiB) Downloaded 86 times
Re: [Drop-In] Excel Import
Interesting stuff, though I get the feeling that its very close to this drop-in I created (quite) a while ago, maybe have a look and see if you can scavenge anything interesting from it.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: [Drop-In] Excel Import
Lols. I definitely did not see that. I'll check yours out.
Re: [Drop-In] Excel Import
Welk in all honesty it was hidden quite well. I just moved it to the drop in section so it can be easier accessed.Sir Flak wrote:Lols. I definitely did not see that. I'll check yours out.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS