Thread: How to tell getline to stop at a specific string...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    40

    How to tell getline to stop at a specific string...

    ...hello again ladies and gentlemen...this is my problem...it is probably dumb and of trivial nature...but I cannot find any guidance elsewhere...
    ...the entire text file I am working with is composed of documents that are separated by '\\\\\'...I need to separate these...how do I tell the program that every time it reads '\\\\\' it needs to increment the counter and store what it has read so far into a data structure that I have created?...so far I am using fstream...reading the file fine with the getline function...but I cannot figure out how to tell it to notice this '\\\\\'...any help would be greatly appreciated...

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    how big is the file? you could read the entire thing in and use the 'strstr()' function to parse the sections yourself.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    40
    ...I will attempt that thank you so much...
    ..."GSXR1300"...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 01-15-2009, 10:04 AM
  2. Program using classes - keeps crashing
    By webren in forum C++ Programming
    Replies: 4
    Last Post: 09-16-2005, 03:58 PM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM