    

 ## On this page

  

 

 # ExportCSVScalar Class Reference

 Last update: 16.07.2025 

Exports scalar data to a CSV file. [More...](class_export_c_s_v_scalar.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)  
  [ExportCSVScalar](class_export_c_s_v_scalar.xhtml#ac0cb9bc2ffb48224a5857667515c08be) (string [output\_file](class_export_c_s_v.xhtml#a8643191a264f6d55fead82a6d23a88b6), [DataObjectContainer](class_data_object_container.xhtml) filter, string [delimiter](class_export_c_s_v.xhtml#a0b2e98e6d6483b285675f9e0128ad223)=",") Initializing all member variables to valid defaults. [More...](#ac0cb9bc2ffb48224a5857667515c08be)  
  [save](class_export_c_s_v_scalar.xhtml#a6a338dc4344270fcbccadf5667ef12f9) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) Exports all data to the given csv output file. [More...](#a6a338dc4344270fcbccadf5667ef12f9)  
 ## <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="ad51161079b951165329d79cb6be52ed1"></a>[DataObjectContainer](class_data_object_container.xhtml) [scalars](class_export_c_s_v_scalar.xhtml#ad51161079b951165329d79cb6be52ed1) The scalar object data to be exported.   
 <a id="a736df6af20bfd263c9b2f906bb16d0f6"></a>bool [write\_design\_numbers](class_export_c_s_v_scalar.xhtml#a736df6af20bfd263c9b2f906bb16d0f6) Writes the design ID before each data set (default: true)   
 <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.

//!Exports SoS scalars to a CSV text file   
When determining the number of designs and quantities to be exported, the method only considers those scalar objects which are part of

See alsoExportCSVSettings::scalars. Hence one can deactivate those quantities which should not be exported..Parameters settingsA setting class containing all the information to control data export to a CSV file Exceptions std::exceptionif more than one quantity is requested to export std::exception in case of conversion errors std::exception in case of program logical errors. Debug mode only 

## Constructor &amp; Destructor Documentation

<a id="ac0cb9bc2ffb48224a5857667515c08be"></a>## [◆ ](#ac0cb9bc2ffb48224a5857667515c08be)ExportCSVScalar()

 [ExportCSVScalar](class_export_c_s_v_scalar.xhtml)  ( string  *output\_file*,    [DataObjectContainer](class_data_object_container.xhtml)  *filter*,    string  *delimiter* = `","`   ) 

Initializing all member variables to valid defaults.

Parameters output\_fileThe name of the output file. filterdelimiterThe delimiter string, e.g. ";", which delimits the data entries within the data sets. See csv::CSVParser::m\_delimiter for more details. 



## Member Function Documentation

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

 virtual check  ( )   virtualinherited 

Checks some settings/preperations.

Exceptions std::exceptionIf the settings are not correct 



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

 save  ( [Structure](class_structure.xhtml)  *database*)   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 Implements [ExportCSV](class_export_c_s_v.xhtml#a61c3eed0322cb79606e39957a8afe9d9).





## Member Data Documentation

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

 string output\_file  inherited 

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