    

 ## On this page

  

 

 # ExportCSV Class Reference

 Last update: 16.07.2025 

Exports scalar data to a CSV file. [More...](class_export_c_s_v.xhtml#details)

## <a name="pub-methods"></a>Public Member Functions

virtual [check](class_export_c_s_v.xhtml#a43937566342ee4168150e9fa232ddfc1) () Checks some settings/preperations. [More...](#a43937566342ee4168150e9fa232ddfc1)  
 <a id="a32bd60ba56a7ef5b90afb0f01a03078f"></a> **ExportCSV** (string [output\_file](class_export_c_s_v.xhtml#a8643191a264f6d55fead82a6d23a88b6), string [delimiter](class_export_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223)=",") virtual [save](class_export_c_s_v.xhtml#a61c3eed0322cb79606e39957a8afe9d9) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b))=0 Exports all data to the given csv output file. [More...](#a61c3eed0322cb79606e39957a8afe9d9)  
 ## <a name="pub-attribs"></a>Public Attributes

<a id="a0b2e98e6d6483b285675f9e0128ad223"></a>string [delimiter](class_export_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223) The delimiter string, e.g. ",", which delimits the data entries within one line.   
 <a id="a5681ad659e91643df77ee5bae59979c6"></a>bool [optiSLang\_compatibility](class_export_c_s_v.xhtml#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](class_export_c_s_v.xhtml#a8643191a264f6d55fead82a6d23a88b6) The name of the output file. Must be non-empty. [More...](#a8643191a264f6d55fead82a6d23a88b6)  
 <a id="a2f8b3cba47ad64fb6bda4b6428a032d3"></a>bool [replace\_files](class_export_c_s_v.xhtml#a2f8b3cba47ad64fb6bda4b6428a032d3) If this is true, an existings output file will be overwritten. Otherwise an exception will arise (default: false)   
 <a id="details" name="details"></a>## 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

<a id="a43937566342ee4168150e9fa232ddfc1"></a>## [◆ ](#a43937566342ee4168150e9fa232ddfc1)check()

 virtual check  ( )   virtual 

Checks some settings/preperations.

Exceptions std::exceptionIf the settings are not correct 



<a id="a61c3eed0322cb79606e39957a8afe9d9"></a>## [◆ ](#a61c3eed0322cb79606e39957a8afe9d9)save()

 virtual save  ( [Structure](class_structure.xhtml)  *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](class_export_c_s_v.xhtml#a8643191a264f6d55fead82a6d23a88b6 "The name of the output file. Must be non-empty. ") given

Parameters databaseThe database containing all objects. Exceptions std::exceptionIf the output path is not a directory std::exception If no the output\_file is not writeable Implemented in [ExportCSVField&lt; TYPE &gt;](class_export_c_s_v_field.xhtml#a6a338dc4344270fcbccadf5667ef12f9), and [ExportCSVScalar](class_export_c_s_v_scalar.xhtml#a6a338dc4344270fcbccadf5667ef12f9).





## Member Data Documentation

<a id="a8643191a264f6d55fead82a6d23a88b6"></a>## [◆ ](#a8643191a264f6d55fead82a6d23a88b6)output\_file

 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