473,395 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

read space through file handeling

Hi All,

I am using file handeling in C lang.

Can anyone please let me know that how can i read spaces from a perticular file??

To read some values (strings) i m using fscanf func.

Can anyone plz help me on this.


Thanks,
Sharique
Aug 14 '08 #1
4 2230
gpraghuram
1,275 Expert 1GB
you can read character by character and find out whether it is a space.
To read character by character you shuld us fgetc()

Raghu
Aug 14 '08 #2
Thanks ..i will try this...

you can read character by character and find out whether it is a space.
To read character by character you shuld us fgetc()

Raghu
Aug 14 '08 #3
Hi Rahgu,

I want to read from a file which is having space delimeters and more than 5 rows like:

Reuters syr2d2 SSL_D2000 Y U REUTERS
EBS ebsctrl SSL_D2000 N B EBS
F1XONLINE fxolimp f1xonline_deals X F F1XONLINE FXLOC

at line 1 and 2 ..in the last space is there...so want to read that space...

Can u suggest me on this?


you can read character by character and find out whether it is a space.
To read character by character you shuld us fgetc()

Raghu
Aug 14 '08 #4
gpraghuram
1,275 Expert 1GB
Hi Rahgu,

I want to read from a file which is having space delimeters and more than 5 rows like:

Reuters syr2d2 SSL_D2000 Y U REUTERS
EBS ebsctrl SSL_D2000 N B EBS
F1XONLINE fxolimp f1xonline_deals X F F1XONLINE FXLOC

at line 1 and 2 ..in the last space is there...so want to read that space...

Can u suggest me on this?
What you can do is convert the file with space at end to someother character using sed in Unix and the do the normal reading.
At the end convert the character to space.

raghu
Aug 14 '08 #5

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

Similar topics

5
by: Matthew Sims | last post by:
I see what my problem is but not sure what I need to change. I'm reading a single number from a file that's fed into an array but the array doesn't want to print out its output. $oncall=array();...
8
by: Gurk | last post by:
hi the settings of my program are stored in an ini file, is there a simple way to open the file in some textbox, ore a betteer soutable box. i also want it to be able to resave the ini so...
4
by: pisscot | last post by:
Lind Apr 13, 6:32 am show options Newsgroups: comp.lang.c From: piss...@gmail.com (Lind) - Find messages by this author Date: 13 Apr 2005 06:32:15 -0700 Local: Wed,Apr 13 2005 6:32 am...
1
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each...
5
by: Denis Petronenko | last post by:
Hello, how can i read into strings from ifstream? file contains values in following format: value11; val ue12; value 13; valu e21;value22; value23; etc. i need to read like file >string,...
9
by: srikanth | last post by:
i have a text file like below, test.txt file (actually my test file file is with 10000 lines but here i tested with 3 lines) 3 06.09.2006 16:37:25 3 06.09.2006 16:40:02 3 06.09.2006 16:42:31...
3
by: Kbalz | last post by:
I have a Form that is performing a wizard-like step system (using TabControl), and I need a key combination (like ControlKey + A + T) to be caught and show a secret admin TabPage. I tried to add...
1
by: ashruba | last post by:
I want to read inbox of nokia N72 through file handeling in c/c++ please give guidence.
9
by: shariquehabib | last post by:
Hi All, I want to get some values by reading a file (already created) through file handeling but dont want to get DUPLICATE values. How can i do that..plz help me out....... E.g: file name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.