Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Realm Works Forums > Realm Works Discussion

Notices

Reply
 
Thread Tools Display Modes
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 15th, 2017, 03:46 AM
Hello RW Community,

I have been quietly working on a generic CSV import tool which (hopefully) requires no programming knowledge for the user.

There are several steps to using the tool:

0. Download the installer from https://github.com/farling42/csv2rw/....17/CSV2RW.exe

1. Prepare data from RealmWorks

1.1 Create a structure only export of the realm.
(Go to the "Share" tab, select "Manage Exports"; in the new window select the "Export Realm Structure Only" tab, type something into the "Name" box, prese the "Save Changes" button, then press the "Full Export" button to generate the RWstructure file.)

1.1.1 (Optional) Within RealmWorks, if you want additional labelled snippets to be used during your import, then you should add these into the Realm Works category definition (possibly making a copy of a predefined category definition) before creating the structure only export.
(Go to the "Manage" tab, select "Categories", choose the topic/article category which you want to use, select the tool icon and select "Create duplicate of category".)

1.2 If you want to load a collection of images and/or herolab portfolios and/or other data types, then the name of these files should be specified in one of the columns in the CSV file. A separate file will be loaded for each row of the CSV, although you can use the same filename in more than one row of the CSV if required.

2. Use the tool

2.1 Start up the CSV Import tool.

2.2 Press the "Load CSV" button and choose the file containing your CSV data.

2.3 Press the "Load Structure" button and choose the file containing the RealmWorks structure-only export file.

2.4 Select the required category type in the drop down menu below the "Load Structure" button to choose the category that you want your CSV data to be imported into. (This should be the "copy" that you made of the predefined category/article structure.)

2.5 Drag each of the CSV column names from the left panel to the corresponding place in the category in the right panel.

2.5.1 If the snippet should be revealed, then select the first radio box on the line (the circle). If the snippet should be marked as GM-only, then select the second radio box on the line.

2.5.2 If you want to remove a field from the category panel, then just right-click the field to remove it.

2.5.3 If you want a field to contain the same text in all occurrences of the topic/article, then you can add text directly into the field, or choose a particular tag from the drop-down list (instead of dragging one of the CSV column names across).

2.6 If you want all your topics/articles to be imported as children of another topic; then tick "Use Parent Topic", choose a category for the parent, and enter a name for it (optionally with a prefix and suffix for the parent too).

2.7 When you have all the fields defined, press the "GENERATE" button at the bottom-right of the window to generate the export file.

3 Import into RealmWorks

3.1 Import the generated file into your realm.
(Go to the "Share" tab, select "Import", click on the box next to "File to Import" and select the rwexport file generated by the CSV tool. Then press the "Import" button.)

3.2 If desired, you can then convert all the "copied" categories to the corresponding predefined category.
(Go to the "Manage" tab, find the category you copied, select "Move All Articles to Category" or "Move All Topics to Category" and select the predefined category.




OR you can work with a copy of a category and add your own labeled text snippets::



---

NOTES

It is no longer mandatory to make a copy of a predefined category, however if a copy is made (or a user defined category is used), then the additional greyed-out placeholder text will be displayed within this tool.

The first line of the CSV file is assumed to have the field names in it.

The bottom panel of the window shows the contents of the CSV file, so you can double-check that you are choosing the correct field.

For the domain selection parts of a topic, you can drag the CSV field name directly onto the drop-down marker in the right panel; or if you want the plain text then you can drop it into the "annotation" part of the window.

Note that if the value does not exist in the tags available from RealmWorks, then no value will be put into the RWexport file.

A field from the CSV panel can be dragged to more than one place in the topic/article panel if you want the same data in more than one place (usually used to set both the tag selector and the annotation field for the same item).

Last edited by Farling; November 18th, 2017 at 05:37 AM.
Farling is offline   #1 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 15th, 2017, 03:47 AM
Release Notes

v1.17
When reading images from a web URL, follow web redirects which are issued by the web server.
A progress bar is also displayed when performing the GENERATE, so that you can see how quickly (or slowly) it is working.

v1.16
When loading an image (see V1.11) it is now possible to specify a web URL instead of just a local file name. Note that the URL must point directly to the image, not to a web page which contains an image somewhere inside it.
The GENERATE button will now be disabled when the file generation process is in progress. This helps you know when the generation is complete (accessing files using a web URL can be very slow).

v1.14
When importing blocks of text, convert URLs so that they appear in Realm Works as clickable links.

v1.13
A mistake with github meant that the wrong code was tagged, so ignore this version (typical for number 13 anyway!)

v1.12
This version fixes a bug in the CSV reader where a " at the end of a line was not being handled properly.

v1.11
Need to load HeroLab portfolio files for all your favourite NPCs?
This version extends the file loading to allow loading data for the following snippet types: Portfolio, Statblock, Rich_Text, PDF, Audio, Video, HTML, Foreign.

v1.10
Load images into the RWexport file...
A column is chosen in the CSV file to use for the Picture or Smart-Image snippet.
The text in the column is the name of the file to load as part of the GENERATE process.
The file can either be a full or relative path to the file; if no path is given then the file must be in the same directory as the CSV file.
If the file does not exist, then a warning will be generated during the GENERATE process. The resulting file can still be loaded into Realm Works, in which case the snippet will show the name of the file even though the image itself will remain blank.
(Also, upgraded from Qt 5.8 to Qt 5.9.2 - this should have no impact on users.)

v1.9
Multi-line quoted cells are now supported in the CSV file.

Also, when you one of these fields then a blank line is created as a paragraph break when the data is being put into a Realm Works field which is either a Multi_Line or Label_Text field (the two fields which allow more than one line of text).

v1.8
This release fixes an issue where the RWEXPORT file would contain one or more blank topics if the original Realm Works structure file contains a category defined as a child of another category. (E.g. Location in the basic Pathfinder category structure).

v1.7
A small update which ignores blank lines in the CSV file. This prevents an empty topic being created in the RWEXPORT file which caused Realm Works to reject the import.

v1.6
A minor update which remembers the last path you used for each of the three file dialogs (each is remembered separately).
A tidy-up of code means that the text in the structure section is never mixed up with text in the topics section.
Multi-line text is now possible.
The lovely (R) has been added to all uses of the term Realm Works(R).

v1.5
This release allows you to type in some free text into a snippet, or choose a tag for a choice field, instead of having CSV data appear in the field.
You can't mix CSV data and free text in the same snippet (yet) though.
It also fixes a bug where sometimes a partition in the structure part of the XML file would wrongly get text attached to it.

v1.4
The entire topic, as well as the optional containing topic, can now be marked as REVEALED to players (using the circular button to the left of topic name).
This updates the existing functionality where individual snippets could be marked as revealed.

v1.3.1
A minor update to add validation to the new optional parent. You must enter a name, and you must choose a different category for the parent to the one chosen for the CSV data.

v1.3
This release see the addition of an option to allow a parent containing topic/article to be specified for all the topics which are to be created from the CSV file.

v1.2
The installer now adds the application to the Start Menu.
Fixed a bug with the layout of elements when there was a blank snippet in the template.

v1.1
Blank cells in the CSV file don't produce unnecessary elements in the output file.
Ensure that the annotation child appears before the tag_assign child in relevant elements.
Ensure the name of the topic/article is assigned one of the CSV fields.
Remove the "GM only" button from each snippet, since it doesn't do anything.

v1.0.0
The top drop-down menu does nothing.


TO DO
Save the configuration of CSV field to category field mapping.
Allow predefined text and CSV field names to be mixed together within certain text snippet types.
Improve the CSV value => Domain mapping so that partial matches are possible (comma separated lists of multiple tags is already supported).

Won't Do
The following items should really be handled by setting up the required category definitions within Realm Works before exporting the structure:
Provide support for Labeled_Text fields.
Allow the addition of additional text (and other) snippets to an imported category.
Allow the addition of new sections and subsections to an imported category.

Last edited by Farling; November 18th, 2017 at 05:39 AM.
Farling is offline   #2 Reply With Quote
Bidmaron
Senior Member
 
Join Date: Dec 2010
Posts: 370

Old April 15th, 2017, 05:50 AM
This looks like a very great addition to our toolkits. Can you elaborate on the instruction regarding how to do domain selection?
Any good CSv sources out there?
Bidmaron is offline   #3 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 15th, 2017, 06:24 AM
Quote:
Originally Posted by Bidmaron View Post
This looks like a very great addition to our toolkits. Can you elaborate on the instruction regarding how to do domain selection?
Any good CSv sources out there?
When you have a snippet type which requires a tag, then my tool will take the text from the CSV column and try to find a matching value for the tag.

From the list of CSV fields in the left panel, drag the name of the field across onto the box that contains the black triangle (to the right of the field name).

For example, with the Pathfinder game, if you have a CSV for spells, then the column for the "spell subschool" might contain the text "scrying". My import tool would take the text "scrying" and find the correct tag to put into RealmWorks for this text.
Farling is offline   #4 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 47

Old April 16th, 2017, 05:04 AM
I must be doing something wrong somewhere along the line as each time I go to import after I've generated the export file I get the message that the category does not exist, any advice? Tried with feats and also magic items.
Absintheminded78 is offline   #5 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 16th, 2017, 09:44 AM
Quote:
Originally Posted by Absintheminded78 View Post
I must be doing something wrong somewhere along the line as each time I go to import after I've generated the export file I get the message that the category does not exist, any advice? Tried with feats and also magic items.
Hi, sorry to hear you're having problems.

Is the message about the category not existing coming from my tool or from Realm Works?

Which fields from a CSV are you trying to copy? It is best not to use fields which have lots of HTML mark-up in them since this will likely conflict with the HTML being added by the conversion tool, and also with what Realm Works might be expecting.
Farling is offline   #6 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 47

Old April 16th, 2017, 02:08 PM
Quote:
Originally Posted by Farling View Post
Hi, sorry to hear you're having problems.

Is the message about the category not existing coming from my tool or from Realm Works?

Which fields from a CSV are you trying to copy? It is best not to use fields which have lots of HTML mark-up in them since this will likely conflict with the HTML being added by the conversion tool, and also with what Realm Works might be expecting.
From Realm Works, when I go to import the file generated by your tool it crashes somewhere between 3-5% and the error report states it's because category does not exist.
I'm just using basic text fields from the CSV files from http://www.pathfindercommunity.net/home/databases/, I have already managed to get the spells imported with EightBitz's script so I attempted to bring in the magic items and feats, both gave that error.
Absintheminded78 is offline   #7 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 16th, 2017, 03:20 PM
Quote:
Originally Posted by Absintheminded78 View Post
From Realm Works, when I go to import the file generated by your tool it crashes somewhere between 3-5% and the error report states it's because category does not exist.
I'm just using basic text fields from the CSV files from http://www.pathfindercommunity.net/home/databases/, I have already managed to get the spells imported with EightBitz's script so I attempted to bring in the magic items and feats, both gave that error.
Is it possible for you to provide the RWEXPORT file generated by my tool so that I can have a look at its output? I'd like to see what is happening with the tool.
Farling is offline   #8 Reply With Quote
Absintheminded78
Member
 
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 47

Old April 16th, 2017, 03:28 PM
Quote:
Originally Posted by Farling View Post
Is it possible for you to provide the RWEXPORT file generated by my tool so that I can have a look at its output? I'd like to see what is happening with the tool.
Sure, thanks for having a look

https://drive.google.com/drive/folde...Vk?usp=sharing
Absintheminded78 is offline   #9 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 1,301

Old April 17th, 2017, 05:12 AM
Absinthe,

I'm trying to import your "feat text.rwexport" file at the moment into a newly created "pathfinder" realm. My attempt is currently at 23% and still going. What type of realm are you trying to import into?

The first improvement to the import would be to drag the feat type across to the "selector" in the feat template. The selector is the box containing the triangle. (It will detect multiple tags for the same field in the CSV if they are separated by commas within the CSV field.) You can have the same CSV column appear more than once in the template. See the attached picture
Attached Images
File Type: png imported-screenshot2.png (45.3 KB, 18 views)

Last edited by Farling; April 17th, 2017 at 03:17 PM.
Farling is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:29 AM.


Powered by vBulletin® - Copyright ©2000 - 2017, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.