#include "Basic/VectorNumT.hpp"
#include "Basic/VectorT.hpp"
#include "geoslib_define.h"
#include "gstlearn_export.hpp"
Functions | |
GSTLEARN_EXPORT int | csv_manage (const char *filename, const CSVformat &csv, int mode, int nitem, bool flagInteger=false, bool verbose=false) |
GSTLEARN_EXPORT void | csv_print_double (double value) |
GSTLEARN_EXPORT Db * | db_read_csv (const char *file_name, const CSVformat &csvfmt, int verbose=0, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=false) |
GSTLEARN_EXPORT int | db_write_csv (Db *db, const char *filename, const CSVformat &csv, int flag_allcol=1, int flag_coor=1, bool flagInteger=false) |
GSTLEARN_EXPORT int | csv_table_read (const String &filename, const CSVformat &csvfmt, int verbose, int ncol_max, int nrow_max, int *ncol_arg, int *nrow_arg, VectorString &names, VectorDouble &tab) |
GSTLEARN_EXPORT int csv_manage | ( | const char * | filename, |
const CSVformat & | csv, | ||
int | mode, | ||
int | nitem, | ||
bool | flagInteger, | ||
bool | verbose | ||
) |
Manage the Utility to write into a CSV file
[in] | filename | Name of the CSV file |
[in] | csv | CSVFormat description |
[in] | mode | 1 for opening File; -1 for closing File |
[in] | nitem | Number of items per line |
[in] | flagInteger | true if the numerical values must be printed as integer |
[in] | verbose | Verbose flag |
GSTLEARN_EXPORT void csv_print_double | ( | double | value | ) |
Write a DOUBLE element into the (opened) CSV file
[in] | value | Real value to be written |
GSTLEARN_EXPORT int csv_table_read | ( | const String & | filename, |
const CSVformat & | csvfmt, | ||
int | verbose, | ||
int | ncol_max, | ||
int | nrow_max, | ||
int * | ncol_arg, | ||
int * | nrow_arg, | ||
VectorString & | names, | ||
VectorDouble & | tab | ||
) |
Read the Data frame from a CSV file. Reserved for numerical data frame.
[in] | filename | Name of the CSV file |
[in] | csvfmt | CSVformat structure |
[in] | verbose | 1 for a verbose output; 0 otherwise |
[in] | ncol_max | Maximum number of columns (or -1) |
[in] | nrow_max | Maximum number of rows (or -1) |
[out] | ncol_arg | Number of columns |
[out] | nrow_arg | Number of rows |
[out] | names | Array containing the variable names |
[out] | tab | Array of values |
GSTLEARN_EXPORT Db* db_read_csv | ( | const char * | file_name, |
const CSVformat & | csvfmt, | ||
int | verbose, | ||
int | ncol_max, | ||
int | nrow_max, | ||
bool | flagAddSampleRank | ||
) |
Read a CSV file and load the results into a Db
[in] | file_name | Name of the ASCII file |
[in] | verbose | Verbose option if the file cannot be opened |
[in] | csvfmt | CSVformat structure |
[in] | ncol_max | Maximum number of columns (or -1) |
[in] | nrow_max | Maximum number of rows (or -1) |
[in] | flagAddSampleRank | True To add the rank number |
GSTLEARN_EXPORT int db_write_csv | ( | Db * | db, |
const char * | filename, | ||
const CSVformat & | csvfmt, | ||
int | flag_allcol, | ||
int | flag_coor, | ||
bool | flagInteger | ||
) |
Write the Data frame into a CSV file. Reserved for numerical data frame.
[in] | db | Name of the Db |
[in] | filename | Name of the CSV file |
[in] | csvfmt | CSVformat structure |
[in] | flag_allcol | 1 if all the columns available must be dumped out |
[in] | flag_coor | 1 if the coordinates must be dumped out |
[in] | flagInteger | true if the numerical values must be printed as integer |