CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: File I/O

  1. #1
    Join Date
    May 1999
    Posts
    8

    File I/O

    Hey.

    I have a tab-delimited text-file with entries i want to read from. The data consists of two strings per post which i want to read and then manipulate with. What functions is best to use?

    A record could look like this:

    Accolade <tab> Something_generic_here
    etc..

    Thanks!

    C B

  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: File I/O

    Use CStdioFile. Construct it (no parameters), use its Open() method with the filename and CFile::modeRead|CFile::typeText as the attributes, then use its ReadString() method to read the line as a CString. Use CString's TrimRight() to remove the trailing <CR><LF>. Then use CString's Find() method to locate the index of the <TAB> ('\t'), and use CString's Left() and Right() methods to split the line into its two halves.

    Does this help?



    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    May 1999
    Posts
    8

    Re: File I/O

    Thanks very much

    C B

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