Archi Forum

Archi => Archi Development => Topic started by: Vjerab on November 13, 2015, 14:22:08 PM

Title: CSV Export - Source/Target Name
Post by: Vjerab on November 13, 2015, 14:22:08 PM
Hi,

I was wondering if there is a way to get the object name instead of IDs in the Source and Target columns, when exporting the relationships into CSV?

Thank you.
Title: Re: CSV Export - Source/Target Name
Post by: Phil Beauvoir on November 13, 2015, 14:32:40 PM
If you did this you would not be able to match up the source and target elements should you want to post-process the files.
Title: Re: CSV Export - Source/Target Name
Post by: Vjerab on November 13, 2015, 14:59:13 PM
Quote from: Phil Beauvoir on November 13, 2015, 14:32:40 PM
If you did this you would not be able to match up the source and target elements should you want to post-process the files.
Fair enough, but is there an option in case I don't want to post-process or an option to have both ID and the name in the extract file?

Thanks.
Title: Re: CSV Export - Source/Target Name
Post by: Phil Beauvoir on November 13, 2015, 15:00:11 PM
Sorry, no options. It is what it is.
Title: Re: CSV Export - Source/Target Name
Post by: prgee on November 13, 2015, 15:43:03 PM
Hi,

It's pretty easy to use Excel (or your favorite spreadsheet) to do this after you export the model. Just open the "elements.csv" file and then create a second worksheet tab where you will copy/paste the contents of "relations.csv". Then you can use the "vlookup" function to retrieve the name from the proper row the "elements" tab, using the ID value as the lookup key.

I've attached a sample (in MS Excel) that illustrates this. Note that in Excel you must set the "range lookup" parameter to "false" so it does an exact match on the ID column.

Cheers,
Peter
Title: Re: CSV Export - Source/Target Name
Post by: Phil Beauvoir on November 13, 2015, 15:51:22 PM
Thanks for that, Peter.  8)

Another approach in getting the exact data that you want is to use XSLT to transform either the Archi native XML file, or The Open Group's ArchiMate exchange format XML file. One could create an XSLT to generate CSV, other XML, or HTML. I blogged about it here - http://blog.archimatetool.com/2015/09/28/generating-content-from-an-archimate-exchange-format-file-using-xslt/

Phil