It's all about the answers!

Ask a question

Import issues characters / punctuation in CSV format to IBM Doors


Bart Fransen (1145) | asked Aug 04 '16, 10:38 a.m.
Hello everyone,

Just a short question about importing requirements via CSV to IBM Rational Doors Next Generation.
At the moment, I have to separate the different attributes by commas. This works fine, and I'm able to import artifacts. But the problem occurs when I'm using specific characters.

Of course, the comma is the best example. If I have a sentence in a requirement with commas and I want to import the requirement, I'm getting an error because IBM thinks it's a separator between attributes. 

Other errors occur with the use of quotation marks, question marks, enters etc. All characters (and enters), except a dot will trigger an error.

The funny thing is that if I export a few artifacts, I'm getting a CSV file with quotation marks, and enters and every other character. If I want to import the same file again, I'm overloaded with errors.

What am I doing wrong and how can I solve this, because adjusting all imported atrifacts is not worth the effort?

Thank you in advance!

Kind regards,
Bart

3 answers



permanent link
Koak Lodge (156210) | answered Aug 05 '16, 4:33 a.m.

First, you should better familiarize yourself with the rules for CSV, especially in terms of commas, quotes, and newlines.

https://en.wikipedia.org/wiki/Comma-separated_values#Basic_rules

Second, experiment. Make some artifacts in a DNG sandbox area. Put some commas, (single/double) quotes, newlines, etc in the strings of their attributes and then export them to CSV. Review the CSV (not with Excel, with a text editor) to see how DNG exported the data. That's how DNG expects an import to look. Then make minor changes (not with Excel, with a text editor) to the exported CSV and import to DNG, see how it affects the data in DNG. Rinse and repeat until you understand. :)


Comments
Bart Fransen commented Aug 05 '16, 10:09 a.m. | edited Feb 04 '17, 5:23 p.m.

 Ha M K,


Thank you for your answer. I'm aware of the rules for CSV, but thanks for the heads up.

If I import artifacts with all the characters it seems to work if I save the file via notepad, instead of Excel.

But what I was wondering:

All my artifacts (requirements) are in Excel. I can of course make a CSV file from that, open it in notepad, adjust a few things and than import it in DNG. This works for a few requirements. But the requirements I have to import, are more than a 1000. If I have to go through every requirement and adjust them where ever it is needed, this will take a while. 

Also, at the moment we are still working in Excel, and DNG in parallel. Sometimes it is needed to update DNG with the changes made in Excel. If I want to import everything again, I have to do it all over again. (or I have to keep track of the changes made in Excel, but still...).

Is there a way to do this faster? I there is not, I understand, but then I don't have the feeling I do a lot of extra work for nothing.

(Notepad doesn't understand for example the place where double quotes are standing and it is also not really possible to make a VBA code for it).

Thanks again for all the help!

Grts,
Bart


permanent link
Koak Lodge (156210) | answered Aug 08 '16, 3:50 a.m.

Can you successfully perform a round-trip without manual adjustments?

- export from DNG to CSV

- open CSV in Excel, make some changes, save to new CSV

- import new CSV into DNG without errors and see the modifications in DNG

What kind of "adjustments" are you making before importing Excel-generated CSV to DNG, or can you give an example of a CSV line that is causing errors?


Comments
Bart Fransen commented Aug 08 '16, 4:48 a.m. | edited Feb 04 '17, 5:22 p.m.

 Hello M.K,


I will try to do what you are suggesting. What I'm going to do is the following:

- Export 2 artifacts from DNG.

- Open in Excel and delete the part with METADATA. Other modifications:
  • The part where I used a ; in DNG is cut off and the following text is in the next cell. I made 1 line again. Otherwise I got the error that the Attribute "Artifact Type" could not be found.
- Save to new CSV.

- Import to DNG.

- The errors are in both lines. (I did not saved it via notepad, but via excel as you mentioned.

Validation Errors: 
Row Number: 2
Error Message: CRRRS4212E The server encountered an exception: Index: 8, Size: 1 
Row Number: 1
Error Message: CRRRS4212E The server encountered an exception: Index: 8, Size: 1 

This has to do with the Qutation marks.

The lines are as follows in Excel (don't judge me on the text though):

 id,Primary Text,Justification,Keywords,Test Scope,isHeading,parentBinding,module,Artifact Type
1952,"This is a testing artifact. I will test ""Quotation marks"", of course comma's, question? marks, das-hes, numerical 1002 and last but not least: this one; and we will and with a dot.","Let's see if this will ""work.""",testing,TBD,"","",236,Requirement 2
1953,"And another 1, ""quotation"" mark and the question? with a slash / and also some :.",Also a test.,testing,TBD,"","",236,Requirement 2 

I couldn't get it in better... Total are three lines. This was how I got the export file from DNG. I see that there is a lot wrong in it, but if I'm correct, this is what you asked for. (double quotation marks etc.).

Hope to hear from you soon. And of course, just let me know if I have to do some extra steps / do it differently.

Bart


permanent link
Koak Lodge (156210) | answered Aug 09 '16, 3:15 a.m.
edited Aug 09 '16, 3:22 a.m.
Hmmm... I created this CSV:

id,Primary Text,Artifact Type
,"This is a testing artifact. I will test ""Quotation marks"", of course comma's, question? marks, das-hes, numerical 1002 and last but not least: this one; and we will and with a dot.",Generic Text
,"And another 1, ""quotation"" mark and the question? with a slash / and also some :.",Generic Text

Imported it into DNG, it created two new artifacts, exported the two artifacts, and got back the same (plus id's of course).

Can you give me the exact text from DNG (not filtered through Excel or your adjustments) that is causing the problem? And can you use "pre" tags around it?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.