|
It is often very easy to extract information from applications and devices and store it as CSV data. Data can be exported from Tideway Foundation in this format, see the CSV API for more information. You can also import CSV data into Tideway Foundation, for example you may have information on a number of hosts that you want to import. You can import a CSV file using the Import CSV Data page which is described below. Alternatively, if you have command line access, you can use the CSV import script. Importing a CSV FileTo import a CSV Data File:
See CSV Import Examples for example of using the CSV importer. Notes on the CSV ImporterFile FormatThe CSV file represents a two dimensional table with rows separated by newlines, and columns separated by commas. Commas may be included in that data but must be enclosed between double quote characters. Column names that do not begin with a hash character (#) are treated as names of attributes on the node. Column names that begin with a hash character are treated as key expressions. Key expressions are used to create or update a relationship to another node. See Relationships for more information. KeysThe CSV importer searches the data store for nodes of a specified kind which have a key or keys matching rows in the supplied csv data. Where the keys match, the node is updated, or deleted and recreated depending on the options selected. The first attribute column is used as a key by default. This can be overridden with the Keys option described in the table above. RelationshipsRelationship columns describe a relationship between the node being modified and one or more other nodes. Relationships are defined using a full key expression. The first example shows a link to a single node: #role:relationship:role:kind.attribute This example shows a link to multiple target nodes: #role:relationship:role:kind.attribute,attribute,attribute The first role part is the kind of the role that the node being created or updated plays in the relationship. The relationship part is the kind of the relationship being created. The second role part is the kind of role that the other node plays in the relationship. The kind part is the node kind of the other node. Finally, the attribute or attribute list is the name of the attribute used to find the other node. See the Node Lifecycle Document for information on relationships. Only a single traversal is supported. Type ConversionBy default, the csv importer attempts to convert attribute values to the type defined in the taxonomy. If an attribute is not defined, it is left as a string. If a conversion fails, it is also left as a string. For list types, the value in the CSV file must be in Python list syntax. When the CSV Import Script is used with the --force option, all attributes are left as strings. |
