Configuration files can be used to influence the export and import of parts management data. The configuration file can be selected in the Import records and Export records dialogs (Utilities > Parts > Management > [Extras] > Import and ... > Export ) by clicking [...] in the File type field, if one of the entries "CSV for <...>", "ECAD" or "Text" is selected.
Note:
You have several possibilities for exporting and importing CSV files: You can select the areas "Addresses", "Parts", "Drilling patterns", "Accessory list", and "Accessory placement". These areas may be defined sequentially in a CFG file.
To create a configuration file, open the desired parts database (e.g., by double-clicking the appropriate directory), select the table whose data you wish to import or export (e.g., "tblFunctionTemplate" for the function template table), and carry over all relevant columns except the "id" column into the *.cfg file (using the editor).
The following information must be specified at the start of the cfg file:
- Column separator, e.g., "separator=," to define the comma as the column separator
- The "skipLeadIn" entry must take all the headings into account; since "fieldTitle" and "header" each generate a header line, "skipLeadIn" must therefore have a minimum value of 2.
- The number of lines for a record is defined by the "rowsPerRecord" entry.
- "header" defines the header line, i.e., whatever lies after the "=" will be output as the header line. This entry must also be accounted for in the "skipLeadIn" value.
- Define "fieldTitle=1", so that the names of the fields are output as column headers. This entry must also be accounted for in the "skipLeadIn" value.
- Define "trim=1" so that empty spaces before and after the text are removed on import and the text is carried over left-justified into the EPLAN data field.
- Define "convert-region-dependent=1" so that the numerical representation of the control panel is used during the import. For example, the "German (Germany)" regional scheme means that a period "." is used as the thousands separator and a comma "," is used as the decimal separator (e.g. "1.200,00").
- These entries define the name of the respective table in the form "table=<Table name>" (e.g."table=tblFunctionTemplate").
Note:
By default, a " is imported as "", e.g., "Designation 1: PC with 15"" monitor". You can change the symbol, however, by entering the following line in the cfg file:
textquote=‘
The " is then imported as a ".
The entries for the individual database fields following the definition of the table name are constructed as follows:
variant=[1!#189]
In this example, "variant" is the field from the database. Everything after the "=" is the desired value. The position is specified in the square brackets "[ ]", where everything in front of the "!" defines the number of lines, since a record can also be output over multiple lines. The column information follows the "#" character.
Fixed text can also be assigned to fields. This then appears as (e.g.):
variant="text before" + [1!#6] + "text after" or partnr="Loz."+[1!#4] or partnr="Siemens".
The value in the square brackets "[ ]" can also contain a field with fixed formatting, e.g. variant=[6,5]. Here, the first number specifies column information, the second number after the comma specifies the length of the text, i.e., in this case five characters are read in / out of column 6.
The ...\Parts\EPLAN directory contains the file csvimportexport.cfg, which contains the function template data, among other information:
separator=,
skipLeadIn=3
rowsPerRecord=1
header=Header
fieldTitle=1
table=tblFunctionTemplate
variant=[1!#189]
connectionDesignation=[1!#190]
pos=[1!#191]
terminalNr=[1!#192]
idx1=[1!#193]
idx2=[1!#194]
characteristics=[1!#195]
functiondefcategory=[1!#196]
functiondefgroup=[1!#197]
functiondefid=[1!#198]
intrinsicsafety=[1!#199]
Warning:
Please note that the "tblFunctionTemplate" table may only be imported or exported as a whole. Even if this table apparently contains several fields they are still treated as one field. If, for example, a field has been commented on during the import, any existing entry in the parts management is deleted!
When importing parts data of the file types "CSV for <...>" and "Text", in the configuration file you can also define the language to be used when importing the texts. To do this, the desired language code is specified next to the relevant multi-language fields in the configuration file.
description1="DE_de@" + [1!#26] + ";EN_us@" + [1!#27] + ";RU_ru@" + [1!#28] + ";"
Here, the information for Designation 1 (description1) is split over three columns: Column 26 = German, column 27 = English and column 28 = Russian. The above configuration combines these three columns together.
When you import free properties and attributes, make sure that the identifier in the CSV file is the field name. In addition, a row number is appended for the tables.
A possible definition in the configuration file:
table=tblFreeProperty
description.1=[1!#207]
val.1=[1!#208]
unit.1=[1!#209]
Here, the ".1" represents the first row in the Free properties table. The attributes are edited in the same way.
When importing free properties it is also possible to place all imported free properties on a single line. To do this, in the associated configuration file the free properties to be imported must be listed with the corresponding row number in the Free properties tab. The row number is entered in the form of a dot "." after the description, val and unit field designations.
A possible definition in the configuration file:
table=tblFreeProperty
description.1=[#3]
val.1=[#4]
unit.1=[#5]
description.2=[#6]
val.2=[#7]
unit.2=[#8]
See also
Bills of Materials: Export File Fields
Parts Management: CSV Import and Export for Parts
Parts Management: CSV Import and Export for Addresses
Parts Management: CSV Import and Export for Connection Point Patterns
Parts Management: CSV Import and Export for Drilling Patterns