472,805 Members | 862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Position File Pointer to newline immediately on some condition

Hi

Is there way to go to the start character of the the proceeding line
while reading from a file. (Sth like working '\n' but immediately will
take me one line down)

Lets say; my file is

abcdefghkl
123 23 43 54
12 3 34 56 77
....
....
....
For example when I am reading a specific line I would like to go to the
start of the newline for some reason.

Thx.

Feb 26 '06 #1
1 2077
TB
utab skrev:
Hi

Is there way to go to the start character of the the proceeding line
while reading from a file. (Sth like working '\n' but immediately will
take me one line down)

Lets say; my file is

abcdefghkl
123 23 43 54
12 3 34 56 77
...
...
...
For example when I am reading a specific line I would like to go to the
start of the newline for some reason.

Thx.


std::ifstream in(...);

in.ignore(std::numeric_limits<int>::max(),'\n');

--
TB @ SWEDEN
Feb 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Peter Abel | last post by:
Hi all, I'm working under W2k with Python 2.2.2 (#37, Oct 14 2002, 17:02:34) on win32 I have a file *test_data.txt* with the following content: 0123456789 0123456789 abcdefghi...
1
by: wtnt | last post by:
Hello. I've searched all over and haven't seen another thread with this problem. Please bear with me as I try to explain. thanks. :) I have some programs that need to be cross-platform...
5
by: Magix | last post by:
Hi, I have following in my data file: <12345><Benjamin><Single> <4567><Stephen><Married> <8383245><George><Married> I want to write a function that display according to the line number...
2
by: Bob Cummings | last post by:
Greetings I am stumped. I am trying to create some initial conditions object by reading from a file. These objects have an integer ID and then a list of sub objects. The problem is I will...
7
by: Morten Wennevik | last post by:
A bit non topic but ... When using code blocks which do you prefer while( condition ) { stuff } or while( condition )
2
by: Senthil | last post by:
Hi, The need is to read each line in a text file and based on the read data decision has to be taken whether to reposition the file pointer. The StreamReader.Position does not give current...
3
by: utab | last post by:
Dear all, I have a text file in the form of 1 2 3 4 5 6 --------/--------/--------/--------/--------/--------/ (I just used / to better explain the...
6
by: tomtown.net | last post by:
Hello I'm trying to get a single line removed from a text file using a search pattern (pretty simple: if line contains "NODE1") -> remove line). To achieve this I's like to operate with only the...
6
by: Mahendra | last post by:
I have two cases - 1. When I have a pointer A pointing to a heap memory - What happens when I dereference the pointer A using free(A). It deallocated the heap memory the pointer was pointing...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.