What is the best way for me to create a formated data reading/writing function for a tabulated text file. Say some calls like :
readElement(i,j)
insertRow(elem[])
readColHeaders()
I was wondering if any existing wrapper can do that ?
internal format is tab-spaced data OR CSV.
Thnx-Egon
There are lots of csv readers but I never found something nice.
The easiest is to use boost::tokenize to fill a vector<vector<string> > from your file. A fancier way is to use boost::spirit (but the learning curve is a rollercoaster).
To generate sur a file, iterating on a vector<vector<string> > is quite trivial.