Author Topic: CSV Export - Source/Target Name  (Read 3440 times)

Vjerab

  • Newbie
  • *
  • Posts: 2
CSV Export - Source/Target Name
« 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.

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1514
  • Archi Guy
    • Archi
Re: CSV Export - Source/Target Name
« Reply #1 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.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

Vjerab

  • Newbie
  • *
  • Posts: 2
Re: CSV Export - Source/Target Name
« Reply #2 on: November 13, 2015, 14:59:13 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.

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1514
  • Archi Guy
    • Archi
Re: CSV Export - Source/Target Name
« Reply #3 on: November 13, 2015, 15:00:11 PM »
Sorry, no options. It is what it is.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

prgee

  • Active Member
  • ***
  • Posts: 62
Re: CSV Export - Source/Target Name
« Reply #4 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

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1514
  • Archi Guy
    • Archi
Re: CSV Export - Source/Target Name
« Reply #5 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
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate