diff --git a/lib/raweat.hpp b/lib/raweat.hpp index 28df285..684b036 100644 --- a/lib/raweat.hpp +++ b/lib/raweat.hpp @@ -214,12 +214,11 @@ public: totalmarksize += datasec_[mrk.first].size(); } // std::cout<<"totalmarksize "< 0 && "didn't find any predefined marker => probably not a valid .raw-file" ); if ( totalmarksize < 100 ) valid_ = false; - - std::cout<<"\n"; } // get all predefined markers @@ -573,38 +572,29 @@ public: return segments_[marker]; } - // write data to csv-like file - void write_data(std::string filename, int precision = 9, int width = 25) + // write csv file + void write_table(std::string filename, char delimiter = ',', int precision = 6, int width = 25) { - // assert ( segments_.size() > 0 ); - // assert ( datmes_.size() > 0 ); - if ( valid_ ) { // open file std::ofstream fout(filename.c_str()); - // write header - // fout<<"# "; + // define column names (including units) std::string colA = std::string("Time [") + get_temp_unit() + std::string("]"); std::string colB = get_name() + std::string(" [") + get_unit() + std::string("]"); - if ( width > 0 ) + + // write header + if ( delimiter != ' ' ) { - // fout< 0 ) + if ( delimiter != ' ' ) { - fout< maindata = eatraw.get_data(); // std::cout<<"\nsize of data array: "<