?
Solved

Going to next line while reading from file

Posted on 1998-11-23
1
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

743 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