Re: READ and delimited format
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 27 Dec 2006 08:56:11 -0800
Jeremy wrote:
Is it possible to use READ to read a delimited file? i.e.:
JOHN|DOE|123 MAIN ST.|SMALLTOWN|NJ|USA
JOE|SMITH|1 S. MAIN ST. APT 25|BIGTOWN|CA|USA
With a little work, yes. If you want to store the characters between
"|" in separate strings, you can
(1) Read each line into a large string with an "internal read"
read (iunit,"(a)") text
(2) Loop through "text" to determine the positions of the the
delimiters.
(3) Use character substring operations to store the appropriate parts
of "text" in separate character variables. For example
cc(1) = text(1:10) ; cc(2) = text(12:15)
if delimiters appear in the 11th and 16th positions of "text".
.
- Follow-Ups:
- Re: READ and delimited format
- From: Dan Nagle
- Re: READ and delimited format
- From: dpb
- Re: READ and delimited format
- References:
- READ and delimited format
- From: Jeremy
- READ and delimited format
- Prev by Date: Converting string to Integer, Real, etc...
- Next by Date: Re: Converting string to Integer, Real, etc...
- Previous by thread: READ and delimited format
- Next by thread: Re: READ and delimited format
- Index(es):
Relevant Pages
|
|