?
Solved

Going to next line while reading from file

Posted on 1998-11-23
1
Medium Priority
?
164 Views
Last Modified: 2013-11-20
I am doing some data acquisition stuff and happen to have as much as 8000 sets of numbers in one line and each number being at least 8 digits 8*8000 is a big number for me to use with //getline(buffer,max)//for the buffer(waste of memory).I want to read a number in between those 8000 sets which I can and I need to go to the next line after that is there an option while reading from a file to go to the next line without using getline(buffer,max)command......
0
Comment
Question by:sram
1 Comment
 
LVL 7

Accepted Solution

by:
psdavis earned 100 total points
ID: 1325190
Since this is a file that you are reading, the only way to know where the end of line character '\n' is, is to read the data.  The system doesn't know any better than you do where the line is.

I would use CFile::Read or CFile::ReadHuge to read it since it is probably going to read your data *anyway*.  Most read commands will get a chunk of memory from the disk and cache it.

No, I don't believe that there is a command to skip to the next line.  But leave this open for a while for descenting opinions.  (There are always some).

Phillip
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question