473,494 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Line reader function

10 New Member
Hi everyone
Is there any function in c which can read the first characters of two lines,then the second ones so on ?

For example
If we have
a b c d
A B C D
it gives us : aA then bB so on

How can we implement this function in C???

Cheers
May 11 '07 #1
2 1585
gpraghuram
1,275 Recognized Expert Top Contributor
Hi,
fscanf reads the characters till it encounters a space.
So you can use that.
You can achive what u need by first reading the line using fgets, and then using sscanf to read it .

Thanks
Raghuram
May 11 '07 #2
sicarie
4,677 Recognized Expert Moderator Specialist
Hi everyone
Is there any function in c which can read the first characters of two lines,then the second ones so on ?

For example
If we have
a b c d
A B C D
it gives us : aA then bB so on

How can we implement this function in C???

Cheers
I think the easiest way would be to pull both lines into different variables, and then parse them as needed, in which case I'd recommend getline().
May 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

40
61163
by: Abby | last post by:
My .dat file will contain information like below. /////////// First 0x04 0x05 0x06 Second 0x07
7
3942
by: BlueOysterCult | last post by:
Hello all I have a project that I have to read the file - which I have done I can see the file output. I then need to read the line - parse the line into three separate values (there are 3 = name...
2
9936
by: Tim Bücker | last post by:
Hello. Is there a way to read a specified line in a textfile? Something like TextReader.ReadTextLine(4); It seems very odd to use reader.ReadLine(); reader.ReadLine(); reader.ReadLine();...
6
6593
by: Maziar Aflatoun | last post by:
Hi, I have a little application that reads a text file line-by-line and processes each line depending on the CVS values. Now I want to change my program to capture this from a textbox. How do...
2
5037
by: Patrick Olurotimi Ige | last post by:
Why do i get "Invalid attempt to FieldCount when reader is closed" Is the problem the way the datareader reads data as opposed to a dataset? When trying to compile this code:- Dim reader As...
6
1842
by: Adrian Lin | last post by:
Is there a way to read a specfic line in a text file? For instance if I wanted to just read the 5th line is that possible without having to step through the other lines? Essentially I am doing huge...
2
6784
by: Sebastian Bassi | last post by:
Hi, In my CSV file, the first line has the name of the variables. So the data I want to parse resides from line 2 up to the end. Here is what I do: import csv...
10
5424
by: spowel4 | last post by:
I am using streamreader.readline to read in data from a file line by line but I need to be able to check for the end of each line, how can I accomplish that using streamreader.readline or is there...
17
24499
by: denislagoda | last post by:
I am a beginer. I need to read a TXT file line by line How to do it?
6
9282
by: kimiraikkonen | last post by:
Hi, I want to save all the item content of a listbox line by line into a simple text file then recall them when my project is opened. For example listbox1 contains: That - item1 Group ...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.