CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2006
    Posts
    2

    Parsing a inderterminate number of files

    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?

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Parsing a inderterminate number of files

    You can use FindFirstFile and FindNextFile functions.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    May 2005
    Posts
    4,954

    Re: Parsing a inderterminate number of files

    This FAQ might help you.

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  4. #4
    Join Date
    Sep 2000
    Location
    Russia
    Posts
    262

    Re: Parsing a inderterminate number of files

    Try any Regular Expression parser library, for example, Regex from www.boost.org (http://www.boost.org/libs/regex/doc/index.html)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured