comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Suppress return with readf ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Suppress return with readf ? [message #13602 is a reply to message #13409] Tue, 24 November 1998 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
John Kwiatkowski wrote:

> I have an ASCII data set that is giving me problems. I need to suppress
> the return when using readf since I only want to read in part of the
> line. Depending on the value of one of the fields there may be more
> info to read on that line. Anyone know how to stop readf from moving
> to the next line?
>
> Here is an example of 2 lines in the data file
> 0 58 2 94 2 0 0 0 0
> 0 57 7 85 44 0 0 0 2 0 0 0 2 0 0 0
>
> The first line has the 9 fields that are on every line. Depending on the
> value of the 9th field there may be 7 more fields to read on that line.
>
> psuedo code:
> A ; structure with required 9 fields
> B ; structure with optional 7 fields
>
> readf, unit, A
> if (A.field9 neq 0) then
> readf, unit B
>
> After the first read the file pointer gets placed at the next line in
> the file. How do I suppress this?
>
> Thanks for any help
> John K.

If you do a byte read in like this you got no problems with the linefeed or
carriage return lindfeed

PRO x_test
a=0B
OPENU,10,'test.txt',/bin
READU,10,a
PRINT,STRING(a)
READU,10,a
PRINT,STRING(a)
READU,10,a
PRINT;STRING(a)
CLOSE,10
END
[Message index]
 
Read Message
Read Message
Previous Topic: TV/postscript problem
Next Topic: Dumb Dumb Question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 15 09:46:43 PDT 2025

Total time taken to generate the page: 0.71910 seconds