archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
955 stars 268 forks source link

Export to CSV is adding =" in id field and import is failing with invalid id #840

Closed amiyadas77 closed 2 years ago

amiyadas77 commented 2 years ago

Version of Archi

4.9.3 ### Archi Plug-ins No ### Operating System Windows 10 ### Expected Behaviour CSV data should be imported without error ### Actual Behaviour

While exporting the model to CSV file, around 200+ id fields have non-guid characters "= like below "=""0341166e-ea92-4de6-b5ad-095bd697d91f""","BusinessActor","Business Actor","","" While importing back the elements.csv it's throwing Invalid character found in ID image

The Open exchange model file doesn't have the =" characters in the id `

Business Actor
</element>`

Steps to Reproduce the Behaviour

  1. I can't share the model as it has server details
  2. Export a model to csv 3.Open in notepad to find if there is "=" like characters in the id field
  3. import the same file back to get the above error.
Phillipus commented 2 years ago

This is intended and happens if a field starts with "0" or a space and you want to export for MS Excel compatibility. The option can be turned off in the export dialog.

See https://community.oracle.com/tech/developers/discussion/550001/excel-export-lost-the-0-at-the-beginning

amiyadas77 commented 2 years ago

@Phillipus Thanks for quick update. So if the guid is starting with zero then the csv will have "= appended. But my issue is while importing back why it's throwing the error?

Phillipus commented 2 years ago

As I said, if you are not exporting CVS to import it in MS Excel, the option should be turned off in the export dialog - uncheck "Excel compatible". This option is not suitable if you are re-importing to Archi.

amiyadas77 commented 2 years ago

@Phillipus, I am importing back to Archi, not excel. To give more background, I need to update the entire model marking decommissioned VMs and adding new VMs Nodes. I have a python script to compare the elements.csv, and VMware exported a list of current VMs. The script will prepare updated elements.csv with new nodes and properties(e.g. IP address, VLAN, disk size etc.)

The script was working fine before 5-6 months; now, when I refresh the data, it's throwing the error. Even if I export/import the Archi elements.csv without manipulating it, it's throwing the above error.

Is this error with improper ID or some other exception it's eating?

Phillipus commented 2 years ago

As I said, the option "Excel compatible" should be turned off in the export dialog.

amiyadas77 commented 2 years ago

@Phillipus I have unchecked the excel compatible option. Now, I am getting below error with manipulated elements.csv image I have seen the new version of the Archi has added a Specialization column in the output. My script was creating only 4 fields "ID","Type","Name","Documentation". Shall I add Specialization? or it's optional while importing into Archi?

Phillipus commented 2 years ago

Specialization is optional.

Please attach a sample CSV file which contains the error.

Phillipus commented 2 years ago

If you are manipulating the CSV files outside of Archi that is not an Archi issue. Closing this one.