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

Home » Public Forums » archive » Re: Problem with IDL output files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Problem with IDL output files [message #13986] Thu, 14 January 1999 00:00
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
TTS wrote in message <77h5in$1ha@edrn.newsguy.com>...
> Hi there...!
>
> Using IDL 5.1 in a PentiumII NT 4.0 box this line of code:
>
> for i=0L, 307199 do printf, wlun, image(i), format='(I1)'
>
> create files with RETURN (\r) and LINE FEED (\n) terminations...
>
> How could I modify this so just RETURNS (^M) is used to finish
> the lines?

Use an unformatted write:

for i=0L, 307199 do begin
s = string(image[i], format='(I1)')
writeu, wlun, s, 13B
endfor

This may not be very fast! In principle, the following should be faster, but
you will find that the explicitly formatted string conversion is limited to
1024 lines.

writeu, wlun, string(image, format='(I1)')+string(13B)

AFAIK, you can't change the line terminator used by PRINTF

--
Mark Hadfield, m.hadfield@niwa.cri.nz http://www.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
Re: Problem with IDL output files [message #13989 is a reply to message #13986] Wed, 13 January 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
TTS wrote:

> Hi there...!
>
> Using IDL 5.1 in a PentiumII NT 4.0 box this line of code:
>
> for i=0L, 307199 do printf, wlun, image(i), format='(I1)'
>
> create files with RETURN (\r) and LINE FEED (\n) terminations...
>
> How could I modify this so just RETURNS (^M) is used to finish the lines?

Use the binary key with openw

R.Bauer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Mode????
Next Topic: Mode????

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

Current Time: Wed Oct 08 17:40:25 PDT 2025

Total time taken to generate the page: 0.00496 seconds