• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

RealmWorks CSV Import Tool

I've been playing around with this tool, which is way freaking cool BTW, and have been having some small issues. Here is what is happening.

I have a slew of data in Excel for Traveller systems. It includes everything from specifications of the system to long descriptions of the history, patrons, adventure seeds, etc. The items that seem to be causing issues are:

1. Many system names (and in several description fields) there is text with ' in them. This is usually in a system name such as "A'eouya", but is also in text such as "The captain's chair". After reading through this topic I tried to put double quotes around the system name, which allowed a small sample import to run, but the system name showed up in RW as "A’eouya​". It also put the "’" in any spot a single quote was in the text.

Is there a way to avoid getting the ’ characters and get the ' instead? And do I need to go put " around every system name that has an ' in it?

2. Many descriptions are multiple paragraphs with line feeds in them. This caused the import to get misaligned and put things in the wrong fields, resulting in it attempting to populate the public_name field with an entry that was a few paragraphs long. I have tried to fix this by editing the CSV file in Notepad++ and it seems to help, but then the text shows up in RW as one big block of text which can be difficult to read.

How can I keep the paragraphs for the import?

3. If I have a text string in the CSV that represents a URL, what type of snippet should I import it into so that it shows up as an active link in the topic view? I tried text, but it just shows up as plain text until I edit something in the topic and save it, at which point it is recognized as a URL.

4. How can I import a simple picture from a URL? I know if I go in and select load from file and put a URL in, it will import the image. Can I do that with an import as well?

Thanks!!!!
 
1. Many system names (and in several description fields) there is text with ' in them. This is usually in a system name such as "A'eouya", but is also in text such as "The captain's chair". After reading through this topic I tried to put double quotes around the system name, which allowed a small sample import to run, but the system name showed up in RW as "A’eouya​". It also put the "’" in any spot a single quote was in the text.

Is there a way to avoid getting the ’ characters and get the ' instead? And do I need to go put " around every system name that has an ' in it?

I think CSV file formats might allow single quote to be used as an alternative to double quotes to mark the boundaries of a single field.

I will have to look to see why the single quote character is being imported as three separate characters. It might be encoding problems.

Could you have a look at the CSV table which is displayed in the bottom half of the window to see if that table still shows the single quote or is showing those three characters? This will help me know if it is the CSV reader or the XML writer which is causing the issue.

Do single quotes appear fine in other parts of text?

2. Many descriptions are multiple paragraphs with line feeds in them. This caused the import to get misaligned and put things in the wrong fields, resulting in it attempting to populate the public_name field with an entry that was a few paragraphs long. I have tried to fix this by editing the CSV file in Notepad++ and it seems to help, but then the text shows up in RW as one big block of text which can be difficult to read.

How can I keep the paragraphs for the import?

I think that multi-line fields can be defined in the CSV file by putting double quotes at the start and end of each field. At the moment, the CSV Import tool puts everything into a single paragraph. I suppose the tool could be updated so that a blank line in the middle of some text marks indicates where a paragraph break is required? Would this handle the text in your case?

3. If I have a text string in the CSV that represents a URL, what type of snippet should I import it into so that it shows up as an active link in the topic view? I tried text, but it just shows up as plain text until I edit something in the topic and save it, at which point it is recognized as a URL.

The conversion from plain text to URL is usually a manual thing that the program does. I could add this into the CSV import tool, possibly as an option in case other users don't want URLs converted (although I guess RW will convert them as soon as the text is edited anyway).

4. How can I import a simple picture from a URL? I know if I go in and select load from file and put a URL in, it will import the image. Can I do that with an import as well?

At the moment it isn't possible to import images easily. I don't think there is a way to encode them in CSV format. The RWEXPORT file format allows images to be defined, but the difficulty is creating a simple way for my CSV import tool to detect an image reference inside the CSV file.

---

So, new feature requests appear to be:

1 - handle single quote properly

2 - detect paragraphs when importing large amounts of text.

3 - detect URLs when importing text.

4 - provide some mechanism to import images.
 
Last edited:
Problem 1 is Smart Quotes being misinterpreted; somewhere along the line they're getting converted to UTF-8 and then reinterpreted as "not Unicode".
 
Last edited:
I think CSV file formats might allow single quote to be used as an alternative to double quotes to mark the boundaries of a single field.

I will have to look to see why the single quote character is being imported as three separate characters. It might be encoding problems.

Could you have a look at the CSV table which is displayed in the bottom half of the window to see if that table still shows the single quote or is showing those three characters? This will help me know if it is the CSV reader or the XML writer which is causing the issue.

Do single quotes appear fine in other parts of text?

the single quotes appear in the preview pane of the tool with or without using double quotes in the CSV file.


I think that multi-line fields can be defined in the CSV file by putting double quotes at the start and end of each field. At the moment, the CSV Import tool puts everything into a single paragraph. I suppose the tool could be updated so that a blank line in the middle of some text marks indicates where a paragraph break is required? Would this handle the text in your case?

Right now the CSV file, when viewed in Notepad++, shows the paragraphs on different lines, with blank lines between them. I think this is what is messing up your tool. As soon as it encounters that in the preview pane you can see where fields are now off. However, that text is in a single cell in Excel. If I edit the file in Notepad++ and remove the lines, it works. But it is all one big paragraph. I can try to play with the formatting in Excel to see what happens. Perhaps I have an extra line feed or something in there that can be removed.

The conversion from plain text to URL is usually a manual thing that the program does. I could add this into the CSV import tool, possibly as an option in case other users don't want URLs converted (although I guess RW will convert them as soon as the text is edited anyway).

If I am putting the links into the correct field, then I don't think there is much more you can do with the tool. It seems to be just the way RW handles it.

At the moment it isn't possible to import images easily. I don't think there is a way to encode them in CSV format. The RWEXPORT file format allows images to be defined, but the difficulty is creating a simple way for my CSV import tool to detect an image reference inside the CSV file.

Currently if I try to assign the path of an image to an image field, the tool crashes. I have no idea how the Import/Export handles images so I can't even begin to guess what the story is there.

---

So, new feature requests appear to be:

1 - handle single quote properly

2 - detect paragraphs when importing large amounts of text.

3 - detect URLs when importing text.

4 - provide some mechanism to import images.

That pretty much sums it up. :)
Thanks!
 
Wow goog luck have t check out the new versio nwhen it comes as well :) Quite an undertaking but this could ease up the import in RW I suppose... quite a bit
 
So can I export what I need for my game and import using this tool?

Trying to do this with the built-in import/export breaks RW, and the devs haven't fixed it for me yet....
 
Farling

I just went through and edited my CSV to remove the line feeds and it imported fine. The singe quotes all imported properly, no editing required from me on that part. So the single quotes issue doesn't seem to be an issue. Not sure what was going on yesterday with it.

The paragraph thing is still an issue. In the CSV file it makes each paragraph a new line, which is screwing up the import. I don't know if there is a way around that.

I changed the Picture snippets back to text and it imported the URLs. I just need to edit a page for them to become active, which while a bit of a pain, isn't all that bad. However, if there was a way top import the file path directly that would be awesome.

Thanks!
 
Farling

I just went through and edited my CSV to remove the line feeds and it imported fine. The singe quotes all imported properly, no editing required from me on that part. So the single quotes issue doesn't seem to be an issue. Not sure what was going on yesterday with it.

The paragraph thing is still an issue. In the CSV file it makes each paragraph a new line, which is screwing up the import. I don't know if there is a way around that.

I changed the Picture snippets back to text and it imported the URLs. I just need to edit a page for them to become active, which while a bit of a pain, isn't all that bad. However, if there was a way top import the file path directly that would be awesome.

Thanks!

Is it possible for you to PM me a link to the CSV file which is causing the bad single quote import problem, and/or the multiple paragraphs problem?

Another file with an image in a CSV file would be useful for testing.
 
If I am trying to export content that was imported into RW using this tool, would that cause a problem? Would different mechanic structures be a factor? Also the report keeps saying, "Domain has no tags defined" before RW crashes.

Thanks in advance
 
Hi Bishop & others,

I have just produced version 1.9 which will help with large amounts of text.

Multi-line quoted cells are now supported in the CSV file. (This has required quite a re-write, so I wouldn't mind knowing if I've broken the import for anybody's existing, previously working, CSV files.)

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). The default paragraph style is used, so there might not be any visible spacing between paragraphs.
 
Last edited:
So, new feature requests appear to be:

1 - handle single quote properly

2 - detect paragraphs when importing large amounts of text.

3 - detect URLs when importing text.

4 - provide some mechanism to import images.

So it looks like (1) is already working properly.

Version 1.9 adds in request (2).
 
If I am trying to export content that was imported into RW using this tool, would that cause a problem? Would different mechanic structures be a factor? Also the report keeps saying, "Domain has no tags defined" before RW crashes.

Thanks in advance

I'm sure about exporting the data again.

Is the "Domain has no tags defined" error being reported during the export process or the import process?

If it is during the export process then either a domain has no tags in it, or there is something else happening which will require you to raise a support ticket with LWD for them to have a look at your realm.
 
I'm sure about exporting the data again.

Is the "Domain has no tags defined" error being reported during the export process or the import process?

If it is during the export process then either a domain has no tags in it, or there is something else happening which will require you to raise a support ticket with LWD for them to have a look at your realm.

It is during the import process. It goes to at most 10% before stopping with the "Domain has no tags defined" message.

I have sent a support ticket as well.
 
I re-did the import with the new version and the paragraph fix worked beautifully.

Thanks!!!

That's good to hear :-)

The next task is how to get images into the RW import file.

Would images be inlined inside the CSV file, or would the filename be present as a field in the CSV file?
 
That's good to hear :-)

The next task is how to get images into the RW import file.

Would images be inlined inside the CSV file, or would the filename be present as a field in the CSV file?

The path and filename would be a field in the CSV. I don't think there is a way to include an actual image in a CSV file. At least not in a format that would be easy to use.
It would either be a URL that returns and image, or a local file path. I assume it would be much easier to use a full path (C:\username\documents\......) than a relative one, unless you specify where to put the image files.
 
The path and filename would be a field in the CSV. I don't think there is a way to include an actual image in a CSV file. At least not in a format that would be easy to use.
It would either be a URL that returns and image, or a local file path. I assume it would be much easier to use a full path (C:\username\documents\......) than a relative one, unless you specify where to put the image files.

I was thinking that for external images, the default location for the files would the same directory as the CSV file.
 
I've just loaded v1.10 which provides the abillity to add images to the RW import file.

The CSV column contains the name of a file to be loaded into the relevant Picture or Smart Image snippet.

The file can either use either the full path, a relative path, or no path. If no path is given then the image must be in the same folder as the CSV file.

If the file does not exist, then a warning is given during the GENERATE process. The generated file can still be imported into Realm Works, in which case the picture snippet will have the name of the file even though the image itself will be undefined.

All image file formats supported by Realm Works should work (I've tested JPG and PNG).

(I've also upgraded the framework from Qt 5.8 to Qt 5.9.2 - please let me know if this means that the tool no longer works for you!)
 
Last edited:
Back
Top