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

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.