cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Reading from specified lines in file in
Reading from specified lines in file in C
Jul 13, 2013 at 12:19pm UTC
Arun Kishorre Sannasi
(1)
i want to read text between two indices in the file using file i/o operations in c++. HOw can i do it? for example, here is the text file:
1:
..
..
2:
..
..
3:
..
..
4:
in this text file i need to print only the lines between 2: and 3:. How could this be done?
Jul 13, 2013 at 2:18pm UTC
zoran404
(263)
I guess that you will have to read the file until you get to the line with text "2:" and then print out the lines until the line "3:".
I doubt there is a simpler way.
Topic archived. No new replies allowed.