This macro will import progress information registered and exported from an external data collection system. For a description of the module itself please see CSV Progress Import, which also explains how to initially generate the configuration files that must be specified in attribute parserFileName of this macro.

Note: requires license to “CSV Progress” import module (see Help->Register…).

Example 1 parameter configuration

This example demonstrates how to import progress information from a project based (i.e. only project id/number is available) CSV progress file.

Macro parameter setup

Content of configuration file (parameter “parserFileName”): custom\progress_progressDemo.xml

Also see list of supported field entries.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<progress name="Progress project demo">
<file decimal="." delimiter="," encoding="windows-1252" stringdelimiter="&quot;"/>
<fields>
<field default="" entry="Progress.project" format="" index="0" virtual="false"/>
<field default="" entry="Progress.operationType" format="" index="1" virtual="false"/>
<field default="" entry="Progress.enddateTime" format="dd-MM-yy HH:mm:ss" index="4" virtual="false"/>
<field default="" entry="Progress.finished" format="" index="5" virtual="false"/>
<field default="" entry="Progress.workloadHours" format="" index="6" virtual="false"/>
<field default="true" entry="Progress.cumulative" format="" index="8" virtual="true"/>
</fields>
<mappings>
<mapping operation="Cutting" type="1"/>
<mapping operation="Grinding" type="2"/>
<mapping operation="Packing" type="3"/>
<mapping operation="Painting" type="4"/>
</mappings>
</progress>

Note that the index=“0” refers to column 1 of the file, index=“1” is column 2 etc.
Example import file (parameter “importFileName”): data/progress.txt

Blue columns corresponds to the index=“X” attribute in custom\progress_progressDemo.xml (see above). Columns not mentioned in progress_progressDemo.xml are ignored during import.

99921,1 ,1429,0,24-08-09 08:00:00,0,1.00 ,0
99921,1 ,1431,0,24-08-09 09:00:00,0,2.50 ,0

Note that in this example a total of 3.50 hours (1.00 + 2.50) are imported because of the flag “Progress.cumulative” is set to true.

Example ROB-EX screen before import

Example ROB-EX screen after import

Example 2 parameter configuration

This example demonstrates how to import progress information from a order based CSV progress file.

Macro parameter setup

Content of configuration file (parameter “parserFileName”): custom\progress_progressDemo.xml

Also see list of supported field entries.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<progress name="Order progress">
 <file decimal="." delimiter=";" encoding="windows-1252" stringdelimiter="&quot;"/>
 <fields>
  <field default="" entry="Progress.order" format="" index="1" virtual="false"/>
  <field default="" entry="Progress.operationType" format="" index="3" virtual="false"/>
  <field default="" entry="Progress.workloadHours" format="" index="6" virtual="false"/>
  <field default="" entry="Progress.enddateTime" format="dd-MM-yyyy HH:mm" index="9" virtual="false"/>
  <field default="true" entry="Progress.cumulative" format="" index="10" virtual="true"/>
 </fields>
<mappings/>
</progress>

Example import file (parameter “importFileName”): data/progress.txt
Blue columns corresponds to the index=“X” attribute in custom\progress_progressDemo.xml (see above). Columns not mentioned in progress_progressDemo.xml are ignored during import.

XXX”;“1003” ;“R867”;“Cutting” ;“2”;“0027”;“1.0” ;“4.55”;“20”;“21-08-2009 07:00”
XXX”;“1003” ;“R867”;“Grinding” ;“2”;“0027”;“4.0” ;“1.12”;“20”;“24-08-2009 12:00”

Example ROB-EX screen before import

Example ROB-EX screen after import

Parameter descriptions

(* = configuration required)

deleteAfterImport
The imported CSV file will be deleted on succesfull completion of this macro

importFileName
the path and file name of the CSV import file.
Note that the path can be specified relative to the ROB-EX root directory – i.e. one step above the location of the .exe used to launch ROB-EX with.

parserFileName
the path and file name of the XML configuration file instructing the import about what “columns” in the CSV import file to import and the meaning of each column. See example files above.
Note that the path can be specified relative to the ROB-EX root directory – i.e. one step above the location of the .exe used to launch ROB-EX with.

Wildcards (*) are supported. So for instance ‘file*.csv’ will import file1.csv, file2.csv and so on.

renameBeforeImport
The file(s) to import will be renamed before the import. The text ‘_renamed’ will be added to the file name. If a file could not be renamed the entire macro stops.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment