Re: Basic format code question [message #50663 is a reply to message #50662] |
Mon, 16 October 2006 01:42   |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Mon, 16 Oct 2006, Wox wrote:
> Hi,
>
> Try this:
>
> openw,lun,path,/get_lun
> a=[11.0335 , 11.0503 , 11.0615,-1.60416e+006 , 1.05404e+007]
> printf,lun,a
> close,lun
> free_lun,lun
>
> openr,lun,path,/get_lun
> b=fltarr(5)
> readf,lun,b ; => this will not work
This works in IDL 6.2 (linux).
> close,lun
> free_lun,lun
>
> What is saved in the file looks like this:
> 11.0335 11.0503 11.0615-1.60416e+006 1.05404e+007
> Problems with the fourth number because of the '-'.
>
What is saved in the file looks like this:
11.0335 11.0503 11.0615 -1.60416e+06 1.05404e+07
regards,
lajos
> Is this normal behaviour for IDL's default formatting?
>
> Suppose the files are already there (can't set format keyword in
> printf), how should I read this file without reading strings (data is
> not fltarr(5) but fltarr(50,50,14))? Using format='(E13)' won't work
> and you can't use repeat count with readf.
>
>
|
|
|