#include "csv.h"
#include "struct.h"
#include <h5cpp/all>
#include "generated.h"
int main(){
h5::max_dims{H5S_UNLIMITED},
h5::chunk{10} | h5::gzip{9} );
h5::pt_t pt = ds;
ds["data set"] = "monroe-county-crash-data2003-to-2015.csv";
ds["cvs parser"] = "https://github.com/ben-strasser/fast-cpp-csv-parser";
constexpr unsigned N_COLS = 5;
io::CSVReader<N_COLS> in("input.csv");
in.read_header(io::ignore_extra_column, "Master Record Number", "Hour", "Reported_Location","Latitude","Longitude");
input_t row;
char* ptr;
while(in.read_row(row.MasterRecordNumber, row.Hour, ptr, row.Latitude, row.Longitude)){
memset(row.ReportedLocation, 0, STR_ARRAY_SIZE);
strncpy(row.ReportedLocation, ptr, STR_ARRAY_SIZE - 1);
h5::append(pt, row);
}
}
h5::at_t create(const hid_t &parent, const std::string &path, args_t &&... args)
Create a new attribute of element type T on a parent HDF5 object.
Definition H5Acreate.hpp:100
T aread(const hid_t &ds, const std::string &name, const h5::acpl_t &acpl=h5::default_acpl)
Read an attribute by name and return its value as type T.
Definition H5Aread.hpp:76