It is possible to import components directly to the components database from a CSV file, that is a standard approach for interchanging data between systems. The import/export functions are located on the components database:
In order to use the import function the input file must follow some rules as the import data must match what is expected to be received.
Example of a valid CSV to import:
name,description,reference,material,type,inside,outside,insideUseful,outsideUseful,length,price,usefulLength,reference1,profit,polygonFaces,stockQuantity,stockDesired,stockAutomatic
"All","internal use only",,,,,,,,,,,,,,,,
"FastSeal","Default HPU brand","HPU Red Premium","HPU Red | FDA","PU","0","25.2","0","25","150","2.89","120","0.25.150","200","0","3.2","4","1"
"FastSeal","Default HPU brand","HPU Red Premium","HPU Red | FDA","PU","0","46","0","46","150","25.5","120","0.46.150","50","0","1.4","30","1"
The columns description are:
Column number | Description |
1 – name | Brand name, for example “FastSeal” – affects the brand table |
2 – Description | Brand description, for example “Good brand” – affects the brand table |
3 – Reference | User designation of a product, for example “HPU Red Premium” – affects the products table |
4 – Material | Brand designation, for example “HPU Red | FDA” – affects the products table |
5 – Type | Must be one of the following words: PU, RUBBER, PTFE or PLASTIC – affects the products table |
6 – inside | Tube measured inside dimension (mm). Must be equal or smaller than inside useful – Materials table |
7 – outside | Tube measured outside dimension (mm). Must be equal or greater than outside useful – Materials table |
8 – inside useful | Tube inside useful dimension (mm) normally matches the sticker on the tube – Materials table |
9 – outside useful | Tube outside useful dimension (mm) normally matches the sticker on the tube – Materials table |
10 – length | Tube length (mm) – Materials table |
11 – price | Cost of tube in local currency – Materials table |
12 – useful length | Tube useful length (mm). Must be smaller than the tube length – Materials table |
13 – reference1 | Material reference – Materials table |
14 – profit | Required profit in % (50 means 50%) – Materials table |
15 – polygonFaces | Number of faces (metal items). For seals leave as 0 – Hidden |
16 – stockQuantity | Numeric value that reflects the quantity in stock (integer or decimals numbers are possible). For example 1.2; 0.3; 0.33332; 4 are all valid numbers |
17 – stockDesired | Integer value that represents the number of tools that is the desired stock. |
18 – stockAutomatic | This column can only have the value 0 or 1. Set to 1 if the software will manage this stock quantity or set to 0 if no change on the stock will be made by the software |
Rules:
- All values must be contained in ” “
- No value can contain a “
- The type (column 5) must be either PU, RUBBER, PTFE or PLASTIC
- The column reference1 is generally the result of the “insideUseful”.”outsideUseful”.”length” columns. See example of the valid CSV file.
- polygonFaces should be 0, as it is a feature for metal machining
- Numeric values uses the dot to separate the decimals. Ex: 345.87
The user can also create, manually, a few materials and export the file. This way a valid file is generated that can be used to import and also serves as a guide/example to create a larger file.
Import dialog
Version higher than 5.2.8.2 have a new and improved import dialog that gives more insight about the import and useful options. The dialog can provide some insight about the contents of the file being imported.
Two main options exist after the file is loaded:
- Read file to replace: This option will check all current brands, products and materials that are currently on the database and will remove all that are not being in use before adding the new products and brands from the database.
- Read file to add: This option will just add new brands, products and materials from the imported file.
In this example, the user is using a database with 76 brands, 30066 products and 31076 materials. This is clearly a wrong constructed database.
Using the option “Read file to replace”, where 3 brands, 2 products and 152 materials are new in relation to the current database, and where 71 brands, 30054 products and 30685 materiais are not being used, will result on a clean database with just 8 brands, 14 products and 543 materials. trying to import 30535 materials, 66 brands and 29518 products.
If the client used the option to add instead of replace, the result would be 76+3 brands, 30066+2 products and 31076+152 materials.
You can edit the * .csv file using Notepad from windows but you need to keep the diagram as described in the blog
e.g:
“Chemobit”, “Chemobite material”, “CHEMOPUR-H”, “CHEMOPUR-H red”, “PU”, “25”, “48”, “27”, “46”, “155”, “16”, “145”, “27.46.155”, “10”, “0”
and you can easily edit the exported file.
each such entry is a single line
import and everything will work fine too