Skip to main content

optiSLang 3D Postprocessing Script API 2025 R1

ImportCSV Class Reference

Last update: 16.07.2025

A class collecting import information for a csv file. More...

Public Types

typedef std::set< string > delimiter_set_type
 

Public Member Functions

 check (Structure database)
 Checks validity of these data. More...
 
 import (Structure database)
 Imports the file with given name filename into the database given. More...
 
 ImportCSV (string filename) throw ()
 Tries to determine some defaults to parse the CSV file filename given into the database. More...
 

Public Attributes

string delimiter
 The delimiter character to be used to parse the CSV file See csv::CSVReader::m_delimiter for more information.
 
bool enforce_integer_design_idents
 true if the design idents to be parsed are to be numbers (else: arbitrary strings)
 
string filename
 The CSV file name to be parsed and imported.
 
bool row_orientated
 Indicates the orientation of the CSV file given. More...
 

Detailed Description

A class collecting import information for a csv file.

Member Typedef Documentation

◆ delimiter_set_type

typedef std::set< string > delimiter_set_type

Constructor & Destructor Documentation

◆ ImportCSV()

ImportCSV ( string  filename)
throw (
)

Tries to determine some defaults to parse the CSV file filename given into the database.

Sets the member variable filename and parses the CSV file to set useful defaults to the member variables delimiter, #m_has_header_line and #m_suggested_delimiters.

Parameters
filenameThe input file name

Member Function Documentation

◆ check()

check ( Structure  database)

Checks validity of these data.

Parameters
databaseThe database where the data is going to be imported to
Exceptions
std::exceptionIf the specified file does not exist std::exception If no header line can be found using the filename and delimiter member variables as input for SoS_CSV_reader_type::testHeaderLine()

◆ import()

import ( Structure  database)

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

Parameters
databaseThe data base where all data is to be added.
Exceptions
std::exceptionIf an equally named data object would be replaced

Member Data Documentation

◆ row_orientated

bool row_orientated

Indicates the orientation of the CSV file given.

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

Connect with Ansys