C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2008, 07:02 PM   #1
Registered User
 
Join Date: Jun 2008
Posts: 1
Unhappy Reading a formatted text file

Hello everyone

I need some help reading data from this text file and storing them appropriatly:

example:

Mike 19 Male Newyork student
Pamela 24 Female Chicago doctor
....

the first column is for names, the second is for age, the third is for gender ,the fourth is for city and the fifth is for occupation. I need to store each one in an appropriate array.
N.B the space between each field(values) is a \t

And sorry for not providing any code simply because i couldn't do it
Thanks in advance.
inspiro is offline   Reply With Quote
Old 06-25-2008, 07:11 PM   #2
and the Hat of Guessing
 
tabstop's Avatar
 
Join Date: Nov 2007
Posts: 8,740
You have formatted input. So you should use a formatted input function. Read up on *scanf, and "strings" in general.
tabstop is offline   Reply With Quote
Old 06-25-2008, 07:39 PM   #3
Registered User
 
Join Date: Sep 2006
Posts: 2,512
Quote:
And sorry for not providing any code simply because i couldn't do it
We're sorry you didn't read your book or attend your classes and take notes. We aren't able to that for you, and not interested in doing homework assignments for students, endlessly.

You post up your code, and tell us what the problem is with it, and we'll be glad to help.

Help, but not do it for you.
Adak is offline   Reply With Quote
Reply

Tags
batch, i/o, read data, text file

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading output into a text file pete212 C Programming 8 04-23-2008 05:11 PM
Reading Character at a time from a text file Giania C Programming 8 02-25-2006 03:17 PM
Reading text file twice, can it be done once? CaeZaR C++ Programming 4 02-04-2006 04:18 PM
How to use FTP? maxorator C++ Programming 8 11-04-2005 03:17 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C Programming 3 03-04-2005 02:46 PM


All times are GMT -6. The time now is 08:05 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22