Re: Problem with IDL output files [message #13986] |
Thu, 14 January 1999 00:00 |
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  |
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
|
|
|