CSV Search
C++: CsvOptions Class

Send comments on this topic.

Description

Class which provides functions to determine the excerpt-fields and filter-fields.

Contents

readFromFile

void readFromFile(
const string& fileName,
const char& fieldSeparator,
const char& withinFieldSeparator);
processes the csv file.

Description

  • grabs 50 lines
  • calculates occurence of each word fpr filter-fields
  • calculates average field length for excerpts-field

Parameters

const string& fileName - .csv you want to parse
const char& fieldSeparator - field-separator of the .csv
const char& withinFieldSeparator - within-field-separator of the .csv

excerptsField

string excerptsField();
returns the field with the highest average field length.

filterFields

string filterFields();
returns the fields with highest average word occurences.

Member Variables

vector _headerLine - contains csv header line fields as elements
std::map _fields - contains average field length
std::map> _occs - contains number occurences of each word
std::map _avgWordOccs - contains number of average occurences of each word

Created with TwinText