Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: File I/O: Reading Formatted Text
Replies: 3   Last Post: Dec 29, 1997 9:10 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
David A. Robinson

Posts: 1
Registered: 12/7/04
File I/O: Reading Formatted Text
Posted: Dec 22, 1997 10:13 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Greetings:
I can't believe I'm posting this question, but I just spent all night
trying to read a simple data file into Matlab, and I couldn't do it. I
have an ASCII file that looks similar to this:

1990 year1 John Doe 1.123 2.234 3.345
1991 year2 Joe Sam Smith 2.234 3.765 4.654
1992 year2 Susan H. Jones 5.432 6.789 1.123

You get the idea - it's strictly formatted with 6 fields (in this
example). I just need to get this thing assigned to Matlab
variables/matrices. (Field three is 14 characters wide, as you suspected.)
I don't know any C, so I'm new to fscanf, fgetl, etc. The Matlab (Ver. 5)
documentation is next to worthless - it has a "detailed" discussion of how
to read a single column of floating point numbers. Thank you very much.

Can someone help me out with this? I'm ready to blow a gasket, and I need
to get on to the "real work."

Thanks in advance,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
David A. Robinson |
The Wharton School, Univ. of PA | '''
2314 SH-DH, 3620 Locust Walk | (o o)
Philadelphia, PA 19104 |-------------oOO--(_)--OOo--------------
V:(215) 573-3150 F:(215) 898-6200 | robinson@wharton.upenn.edu





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.