Click to See Complete Forum and Search --> : Parsing a inderterminate number of files


leftler
July 22nd, 2006, 12:22 AM
what is a good way to parse a bunch of txt files in C++, the constraints being

you know the containing folder
you have a template the names of the files XXXX - XXXX - YYYY/MM/DD - SECONDS_ELAPSED
you dont know how many there will be (>1 deffinatly)


each file will be a csv file which will have its data parsed and sorted. If I can get the ifstreams I know how to do the rest, my only problem is a effecent way to get the correct files to open.


Any sugestions on code tips or libarys I should look at?

Marc G
July 22nd, 2006, 03:02 AM
You can use FindFirstFile and FindNextFile functions.

golanshahar
July 22nd, 2006, 04:27 AM
This FAQ (http://www.codeguru.com/forum/showthread.php?t=312461) might help you.

Cheers

Dmitry Zemskov
July 24th, 2006, 05:22 PM
Try any Regular Expression parser library, for example, Regex from www.boost.org (http://www.boost.org/libs/regex/doc/index.html)