Solved

Going to next line while reading from file

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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