Unable to import default csv export

Hi,
I’m trying to import a CSV and based on From email: import from CSV - #2 by DmitryBarashev it seems that exporting the same project and then importing it should work. However, when I do that I get an error:

The header contains a duplicate entry: ‘ID’ in [ID, ID, Name, Default role, e-mail, Phone, Standard rate, Total cost, Total load]

Full log

WARNING: The header contains a duplicate entry: ‘ID’ in [ID, ID, Name, Default role, e-mail, Phone, Standard rate, Total cost, Total load]
java.lang.IllegalArgumentException: The header contains a duplicate entry: ‘ID’ in [ID, ID, Name, Default role, e-mail, Phone, Standard rate, Total cost, Total load]
at org.apache.commons.csv.CSVFormat.(CSVFormat.java:368)
at org.apache.commons.csv.CSVFormat.withHeader(CSVFormat.java:877)
at biz.ganttproject.impex.csv.GanttCSVOpen.createCSVFormat(GanttCSVOpen.java:237)
at biz.ganttproject.impex.csv.GanttCSVOpen.createReader(GanttCSVOpen.java:223)
at biz.ganttproject.impex.csv.GanttCSVOpen.load(GanttCSVOpen.java:201)
at biz.ganttproject.impex.csv.ImporterFromCsvFile.run(ImporterFromCsvFile.java:73)
at net.sourceforge.ganttproject.importer.FileChooserPage$1.run(FileChooserPage.java:86)
at net.sourceforge.ganttproject.wizard.AbstractWizard.onOkPressed(AbstractWizard.java:161)
at net.sourceforge.ganttproject.wizard.AbstractWizard$3.actionPerformed(AbstractWizard.java:89)
at net.sourceforge.ganttproject.DialogBuilder$1$1.run(DialogBuilder.java:148)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.desktop/java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.desktop/java.awt.Dialog.show(Unknown Source)
at java.desktop/java.awt.Component.show(Unknown Source)
at java.desktop/java.awt.Component.setVisible(Unknown Source)
at java.desktop/java.awt.Window.setVisible(Unknown Source)
at java.desktop/java.awt.Dialog.setVisible(Unknown Source)
at net.sourceforge.ganttproject.DialogBuilder$DialogImpl.show(DialogBuilder.java:77)
at net.sourceforge.ganttproject.wizard.AbstractWizard.show(AbstractWizard.java:151)
at net.sourceforge.ganttproject.action.project.ProjectImportAction.actionPerformed(ProjectImportAction.java:50)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at java.desktop/javax.swing.AbstractButton.doClick(Unknown Source)
at java.desktop/com.apple.laf.ScreenMenuItem.actionPerformed(Unknown Source)
at java.desktop/java.awt.MenuItem.processActionEvent(Unknown Source)
at java.desktop/java.awt.MenuItem.processEvent(Unknown Source)
at java.desktop/java.awt.MenuComponent.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.MenuComponent.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

It seems that it is caused by the resources section because that is where ID is repeated. Is there any documentation on the expected format?

Here’s the file that was created by GanttProject when I exported:
HouseBuildingExample.csv (2.9 KB)

Please share the project file.

I just download latest version (3.2.3200) and have the same issue.
I’ve upload two very simple files: The .gan file and the corresponding .csv file.
The CSV file contains indeed two ‘ID’. Something is wrong. The second id header should be the user name instead.

TestCSVProject.csv (330 Bytes)
TestCSVProject.gan (2.6 KB)

Can you please look into the Settings > Spreadsheets and check if a) there are two ID rows in the “Resource fields” section and b) what if you uncheck the second ID row, like shown below.

I just took a look at it.
Indeed by default both “ID” in Resource fields are checked.

When I unchecked the second ID, and exported the testing CSV file the data seems ok.

When I imported the CSV file it worked as expected.

This fixed the export / import error of this topic.