It's all about the answers!

Ask a question

How can I import RTC work items that contain carriage returns in one of the attributes?

Bob Ferguson (89530) | asked Jun 30 '21, 2:33 p.m.

 I am importing work items into RTC via csv files.  The data is originally coming from an Excel file and I have written a perl script to massage it so that it can be imported.  There are carriage returns in one of the columns and the script replaces them with a tilde (~).  The problem is that when the work item is imported the attribute contains the tilde.  I can replace the tilde with a carriage return via the editor presentation however, I wanted to know if there is a special character I could use that would be changed into a carriage return during the import.

One answer

permanent link
Davyd Norris (1.5k12) | answered Jun 30 '21, 8:49 p.m.
You should be able to just import the carriage return, you just need to make sure you save the file as CSV that's comma separated and that uses double quotes around fields with new lines.

I have had no problems at all importing multi line fields in the past

Ralph Schoon commented Jul 01 '21, 2:07 a.m.

Also make sure what encoding you use. Try UTF-8 as encoding of the CSV file. 

Bob Ferguson commented Jul 01 '21, 8:39 a.m.

 Would I be able to get an example of what the file would look like.

Maybe a file that contains a dummy header with 2 work items with 4 fields, one that has carriage returns.

Davyd Norris commented Jul 01 '21, 9:14 p.m. | edited Jul 01 '21, 9:15 p.m.
Hi Bob,

Try this:
 - go into a CCM project area and either find or create a record where you have manually entered carriage returns in the fields
 - create a new work item query that selects those records and fields and returns them
 - save the query, and then you will be able to export the results as a .csv

That should give you a file format that is able to be directly imported back into your project area and will show you exactly how to format the multi line fields, and it'll be "straight from the CCM horse's mouth" :-)

Your answer

Register or to post your answer.