1.4.1.3.1.2. Import CSV via Batch

You can transfer table values and/or add variables from a CSV file. In the following the procedure is explained with the help of an example:

  1. Initial situation:

    For one line the variable values are complete. The other lines shall be filled from a CSV file.

    It is also possible to add further missing details such as unit [Unit] or correct incorrect details such as storage location [Save location].

    Initial situation

    Initial situation

  2. Make the desired values available via CSV file:

    Example:

    IDNR;NENN;DG;GK;DA;DK;DW;X;H;M;S;T
    Identifikationsnummer;Zeilenbeschreibung;Gewindenenndurchmesser;...;.....;...
    ;;mm;mm;mm;mm;mm;mm;mm;mm;mm;mm
    T;T;Z;Z;Z;Z;Z;Z;Z;Z;Z;Z
    1;M4;4;3.242;4.6;6.5;5.8;1.4;8;3.2;7;5.26
    2;M5;5;4.134;5.75;7.5;6.8;1.6;10;4;8;7.21
    3;M6;6;4.917;6.75;9.5;8.3;2;12;5;10;7.71
    4;M8;8;6.647;8.75;12.5;11.3;2.5;15;6.5;13;10.65
    5;M10;10;8.376;10.8;15;14.3;3;18;8;16;12.65

  3. Call up the function in PARTproject in the catalog index on a project or directory via the context menu command under Automation -> Edit project in batch run [Edit project in batch mode].

  4. Select the option Add variable from CSV/accept values from CSV [Add variable from CSV / take values ​​from CSV].

  5. File selection " dialog area:

    • Enter a CSV manually or use the Browse button ... button to select one or more (Ctrl key) CSV files. If several are selected, they are separated with the pipe symbol.

    • Coding [Encoding]:

      It's about text encoding, normally UTF-8. In this way it is ensured that i.g. umlauts will be correctly processed.

    • CSV format [CSV-Format]: For example, select the Automatically recognize [Try to detect] option in the list box.

    • Separator: e.g. semicolon

      Specifies by which character columns are separated in the CSV file.

      Text identification marks [Sign of text identification]: E.g. double quotation marks

    Click on Continue [Next].

    Now the CSV is read and you will be forwarded to the next dialog page, where the information loaded from the CSV can be adjusted and enhanced.

  6. Column-dependent settings [Column Settings] " dialog area:

    Check the settings and adjust them accordingly - if needed.

    Activate the checkbox for all variables for which you want to make changes.

    • Identifying column [Identifying Column] / variable name in the catalog [Variable name in the catalog]:

      Determine the desired variable for the mapping between CSV file and catalog.

    • Columns to be changed/added [Columns to add/modify]:

      In the following, the meaning of the single table columns is explained:

      • Checkbox: Activate the checkbox for the variables where you want to change the variable values.

        You can activate or deactivate all variables using the checkboxes in the column header (x).

      • Name: Variable name

      • Description: Variable description that is displayed in the table under the variable name.

      • Table variable [Table variables]: Enter a name here if the variable is to be copied from the CSV into the table, but should have a different name there. If the field is empty, the name from the CSV ("Name" column) is copied.

        The specification is taken into account when checking the names. If the variable name in the CSV is invalid for the table (not allowed character e.g.) you can either adjust the name or explicitly set another name and leave the invalid original name.

      • Unit: The unit is displayed in the column header, in square brackets after the variable description. The value can be customized, but may also be empty.

      • Data type: When you open the list field, you can adjust the format if necessary.

        • Text

        • Integer

        • Decimal number (0.1)

        • Decimal number (0.12)

        • Decimal number (0.123)

        • Decimal number (0.1234)

        • Decimal number (0.12345)

      • Status: Select the desired option from the list box.

        • Variable with fixed values (default): Each table row has its own value for this variable.

        • Value range variable: Syntax equivalent to PARTdesigner Variable manager [Variable Manager].

        • Characteristic algorithm [Attribute algorithm]: Syntax equivalent to PARTdesigner Variable manager [Variable Manager]

      • Type identification [Identification type]: Equivalent to PARTdesigner Variable manager [Variable Manager]

        • Geometry attribute

        • Object attribute

        • Function attribute

        • Dimension attribute

        • Feature attribute

        • Structure attribute

        • Additional attribute

      • Translate [Translation]: Use the checkbox to specify whether the respective variable in the project should be added to the variables to be translated or not.

      • Hide: Use the checkbox to specify whether the respective variable should be hidden in the project or not.

      • Group assignment [Variable group]: Optionally determine the group assignment of a variable in the project here.

        Basically a variable can be included in several groups. For this, enter a comma separated list.

        With a prefixed "!", the respective variable can be removed from groups.

      • Storage location [Save location]: Equivalent to PARTdesigner Variable manager [Variable Manager]

        • Only in table

        • In geometry and table

        • Only in geometry

      • Default value: This column specifies a default value in the event that no suitable line is found in the CSV via the identifier.

    • Add columns if they do not yet exist [Add columns if non existent]: If this option is activated, variable columns are created in the table if they do not yet exist there.

    • Only create columns if data is available for the table [Only create columns if there are table data available]: This option prevents a variable from being created in a table if not a single identifier row matches.

  7. " Condition " dialog area: (equivalent to condition in the other batch run modes)

    Here, you can set basic conditions for the batch run. For example, that only visible projects are edited, or only invisible.

    Consider hierarchy checkbox: The folder structure is taken into account. E.G: I only want to edit visible projects. It may be that a project itself is visible, but a directory above it is hidden.

    Example

    Example

  8. Click on Start.

    -> The Fill table column dialog shows the progress.

  9. Result:

    -> The missing values have been read accordingly.

    Result

    Result

Details can be found under Section 5.8.2.1.16.1.6, “ Add variable from CSV / take values ​​from CSV ” in eCATALOGsolutions - Manual.