reading from files - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

reading from files

nathj72nathj72 Posts: 28Member
when you are reading from files how do you skip to the next line down in the file.

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : when you are reading from files how do you skip to the next line down in the file.

    read it one line at a time until you get to the line you want.
    :

  • nathj72nathj72 Posts: 28Member
    : : when you are reading from files how do you skip to the next line down in the file.
    :
    : read it one line at a time until you get to the line you want.
    : :
    :
    :
    I want to read until i get what i want on a line and the just skip over the rest of that line. I want to know if there is a command that will do that

  • stoberstober Posts: 9,765Member ✭✭✭
    : : : when you are reading from files how do you skip to the next line down in the file.
    : :
    : : read it one line at a time until you get to the line you want.
    : : :
    : :
    : :
    : I want to read until i get what i want on a line and the just skip over the rest of that line. I want to know if there is a command that will do that
    :
    :
    no, you have to write the algorithm yourself. But I don't know just what you mean by "skip over the rest of the line". Can you post an example?


  • HK_MP5KPDWHK_MP5KPDW Posts: 770Member ✭✭✭
    : : : : when you are reading from files how do you skip to the next line down in the file.
    : : :
    : : : read it one line at a time until you get to the line you want.
    : : : :
    : : :
    : : :
    : : I want to read until i get what i want on a line and the just skip over the rest of that line. I want to know if there is a command that will do that
    : :
    : :
    : no, you have to write the algorithm yourself. But I don't know just what you mean by "skip over the rest of the line". Can you post an example?
    :
    :
    :

    Is this C or C++... perhaps he means something along the line of the [b]ignore[/b] member function for input streams, i.e.:
    [code]
    ifstream input("file.txt");
    ...
    input.ignore(x,'
    '); // <- replace x with the maximum expected line length
    [/code]
Sign In or Register to comment.