Quote:
Originally Posted by catkin
(Post 4373077)
Which CSV formats do you want to parse?
|
This one:
http://www.robosuv.com/html/rddf_2004.html
Quote:
Originally Posted by catkin
(Post 4373077)
There's a good description of CSV formats here.
|
Thanks, will go through that.
Quote:
Originally Posted by catkin
(Post 4373077)
having line ends in the data adds a level of complexity. If you are interested in deriving an algorithm for C++ from awk please ask and I'll post awk code (which does support line ends in the data).
|
By "line ends" you mean some special characters denoting the end of line? Well that file doesn't have anything other than a '\n' char at the end.
and I am not sure that I have understood what you meant by
"deriving an algorithm for C++ from awk". Did you mean that you'll be writing the code for the same in awk and then I'll translate the awk code to C++?
Anyway, I am an awk/sed/bash/perl illiterate. So won't be able to "read" anything you post in awk.
If you do bother to post the awk code [and also do write "what" each line is doing in plain English], it might be helpful in present/future, to either me or to someone else.
Thanks for your concern.
Quote:
Originally Posted by SigTerm
(Post 4373545)
So, is there some kind of problem?
|
Not any more. Yesterday I went through some of the code of the software
colucix posted. They appeared to be using some libraries, so I thought instead of spending time in exploring, understanding and then extracting code from their software, it is better to
reinvent the wheel again. So, yesterday itself, I read the first row of the file [accidentally that was the only row in the file at that time :rolleyes:], put it in the
std::string and extracted the
substr from it on the basis of position returned by
find function, of commas. Converted the string to
double type by
strtod function..
Didn't think that it would be too simple. Actually previously I had to parse an XML file in Qt and the
Qt mailing list people told me to use a new class instead of regular one for parsing. And it really took quite an amount of time in writing that code, handling all the conditions etc.