> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ImportCSV Class Reference

Part of [Import](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__import)

A class collecting import information for a csv file.

## Public Types

| Type | Name |
| - | - |
| typedef std::set\< string > | [delimiter\_set\_type](#a7ca6b7dfb092f003a8112eab3ab69523) |

## Public Member Functions

| Type | Name |
| - | - |
| | [check](#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Checks validity of these data. |
| | [import](#a73dd3f56399568385400db0c3fc08295) ([Structure](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_structure) [database](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/group__data#gaebcac3a2836ec9fdf2e47bd812994b6b)) Imports the file with given name filename into the database given. |
| | [ImportCSV](#a60886859ba515644d1501c975b1af532) (string [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2)) throw () Tries to determine some defaults to parse the CSV file [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2) given into the database. |

## Public Attributes

| Type | Name |
| - | - |
|  string | [delimiter](#a0b2e98e6d6483b285675f9e0128ad223) The delimiter character to be used to parse the CSV file See csv::CSVReader::m\_delimiter for more information. |
|  bool | [enforce\_integer\_design\_idents](#a05bc029610051c80b0f364bfc6587340) true if the design idents to be parsed are to be numbers (else: arbitrary strings) |
|  string | [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2) The CSV file name to be parsed and imported. |
| bool | [row\_orientated](#ae3708cb2d385c0e5dccbad90b0dd1069) Indicates the orientation of the CSV file given. |

## Detailed Description

A class collecting import information for a csv file.

## Member Typedef Documentation

### delimiter\_set\_type

```cpp theme={null}
typedef std::set< string > delimiter_set_type
```

## Constructor & Destructor Documentation

### ImportCSV()

```cpp theme={null}
ImportCSV(string filename)
```

Tries to determine some defaults to parse the CSV file [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2) given into the database.

Sets the member variable [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2) and parses the CSV file to set useful defaults to the member variables [delimiter](#a0b2e98e6d6483b285675f9e0128ad223), #m\_has\_header\_line and #m\_suggested\_delimiters.

**Parameters**

| Name | Description |
| - | - |
| filename | The input file name |

## Member Function Documentation

### check()

```cpp theme={null}
check(Structure database)
```

Checks validity of these data.

**Parameters**

| Name | Description |
| - | - |
| database | The database where the data is going to be imported to |

**Exceptions**

| Name | Description |
| - | - |
| std::exception | If the specified file does not exist std::exception If no header line can be found using the [filename](#a3a1a90139c2c8ab1fca0ea8b1790b7b2) and [delimiter](#a0b2e98e6d6483b285675f9e0128ad223) member variables as input for SoS\_CSV\_reader\_type::testHeaderLine() |

### import()

```cpp theme={null}
import(Structure database)
```

Imports the file with given name filename into the database given.

**Parameters**

| Name | Description |
| - | - |
| database | The data base where all data is to be added. |

**Exceptions**

| Name | Description |
| - | - |
| std::exception | If an equally named data object would be replaced |

## Member Data Documentation

### row\_orientated

```cpp theme={null}
bool row_orientated
```

Indicates the orientation of the CSV file given.

True means a row orientated format, false indicates a column orientated format.
