\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
csv_write¶
View page sourceWrite a Csv File¶
Prototype¶
void csv_write(
const std::string& file_name ,
const vec_vec_str& csv_table )
vec_vec_str¶
see vec_vec_str .
file_name¶
is the name of the csv file.
The rows in this file are separated by newlines '\n'
and the columns are separated by commas ',' .
There are no other special characters in this file.
csv_table¶
The j-th column of the i-th row of the file contains the value csv_table[i][j] .
0 < csv_table[i].size() for all row indices i .
The character
','is added between columns.The character
'\n'is added at the end of every line.
Example¶
xam_csv_write.cpp contains an example and test of this routine.