Solved

Going to next line while reading from file

Posted on 1998-11-23
1
155 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now