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

    How to find a strin from a file

    I got a .txt file here, and in the file there is a column, "TB". Under the column, there are two kinds of string, "T" or "B". I need write some codes for searing the string ,"T", and put the related data (with string"T") into a new file? Anyone can help me out with this??

    thank you


  2. #2
    Join Date
    Apr 1999
    Posts
    31

    Re: How to find a strin from a file

    You need write code like "parser", to read the text file and extract the string that you want.

    1.you have to know what is the seperator.(, or space)
    2.I am assuming the \n is the end of line.

    Try to write a member function use strtok(..,..)and while loop (!file1.eof()) to get the string "T".


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