Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds ability to handle headers in CSV files. Requires allowing ygm::io::line_parser to read the first line of the first file independently and skip over the first line of files in for_all operations.
This functionality is controlled by a
ygm::io::csv_parser::read_headers()
function that parses the header file to create an internal map from column names to positional indices and puts thecsv_parser
in a state that will skip over processing the header line when callingfor_all
. This could also be accomplished by adding an optional flag to thecsv_parser
constructor, but this would break the symmetry in arguments to the constructors ofcsv_parser
andline_parser
.Additionally, this requires adding a class to handle the CSV lines in a way that items can be accessed through positional indices and column name. The interface of this class is created to match that of the
std::vector<csv_field>
that was used previously, but the fullvector
interface is not implemented.@rogerpearce let me know if this change is consistent with any future changes you have planned for the I/O functionality.