Bugfix: CSV Header: loading and format check using regexps
file: modules/csv/src/ovCCSV.cpp
Method:
void CCSVHandler::extractFormatType(const std::string& header)
... uses regex (defined at the top of the file) to extract the stream format (Signal, Matrix, Feature Vector...)
When using CSV files containing large matrices (ex: 64 channels x 64 channels x 500 frequencies), this format extraction fails. It seems the regex fails when the header is too long.
2 possibilities:
- change the regex to make it work in those cases
😄 - switch from regex to checks based on std::string. An (unfinished) example is provided as attachment.
The second option implies a much longer code, harder to maintain (unless we can (rightfully?) assume that formats won't change in the future). But as it is, I can process CSV files with very long headers without problem.
example code: csvFormatExtraction-test.cpp
Example input file: link (password: testcsv)