> ## 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.

# ExportCSV Class Reference

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

Exports scalar data to a CSV file.

## Public Member Functions

| Type | Name |
| - | - |
| virtual | [check](#a43937566342ee4168150e9fa232ddfc1) () Checks some settings/preperations. |
| | **ExportCSV** (string [output\_file](#a8643191a264f6d55fead82a6d23a88b6), string [delimiter](#a0b2e98e6d6483b285675f9e0128ad223)=",") |
| virtual | [save](#a61c3eed0322cb79606e39957a8afe9d9) ([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))=0 Exports all data to the given csv output file. |

## Public Attributes

| Type | Name |
| - | - |
|  string | [delimiter](#a0b2e98e6d6483b285675f9e0128ad223) The delimiter string, e.g. ",", which delimits the data entries within one line. |
|  bool | [optiSLang\_compatibility](#a5681ad659e91643df77ee5bae59979c6) If this is true, then the idents of scalar-quantities will be modified to match allowed characters in optiSLang (default: false) |
| string | [output\_file](#a8643191a264f6d55fead82a6d23a88b6) The name of the output file. Must be non-empty. |
|  bool | [replace\_files](#a2f8b3cba47ad64fb6bda4b6428a032d3) If this is true, an existings output file will be overwritten. Otherwise an exception will arise (default: false) |

## Detailed Description

Exports scalar data to a CSV file.

Exports only data assigned to the member variables scalars, node\_data, element\_data and intpt\_data. If, and only if, ALL these memeber are empty, then the Settings class tries to write down all the database data automatically. If several data types shall be exported at once, than the output file given will be reused as some kind of template string extended by data type IDs. See the description at *output\_file* for detailed information.

## Member Function Documentation

### check()

```cpp theme={null}
virtual check()
```

`virtual`

Checks some settings/preperations.

**Exceptions**

| Name | Description |
| - | - |
| std::exception | If the settings are not correct |

### save()

```cpp theme={null}
virtual save(Structure database)
```

`pure virtual`

Exports all data to the given csv output file.

If all member variables are empty all objects in the database will be exported. Otherwise the member variables acts as filter and only listed data will be extracted out of the database given and exported to the CSV file [output\_file](#a8643191a264f6d55fead82a6d23a88b6) given

**Parameters**

| Name | Description |
| - | - |
| database | The database containing all objects. |

**Exceptions**

| Name | Description |
| - | - |
| std::exception | If the output path is not a directory std::exception If no the output\_file is not writeable |

Implemented in [ExportCSVField\< TYPE >](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_export_c_s_v_field.md#a6a338dc4344270fcbccadf5667ef12f9), and [ExportCSVScalar](https://developer.synopsys.com/docs/optislang/optislang-3d-postprocessing-script-api/class_export_c_s_v_scalar.md#a6a338dc4344270fcbccadf5667ef12f9).

## Member Data Documentation

### output\_file

```cpp theme={null}
string output_file
```

The name of the output file. Must be non-empty.

Several modes in several situations are supported:

* The string points to a non-existing FS item:

  * The Settings class tries to split up the path given in its components: parent\_path, filename (boost::filesystem::stem) and file extension (boost::filesystem::extension) as described in the underlying FS library [http://www.boost.org/doc/libs/1\_53\_0/libs/filesystem/doc/reference.html#Path-decomposition-table](http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/reference.html#Path-decomposition-table)
  * Non given components will be replaced by default ones and created if neccessary
