Solved

Going to next line while reading from file

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

759 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

19 Experts available now in Live!

Get 1:1 Help Now