On Sep 22, 10:48 am, woods1 <merria...@yahoo.fr> wrote:
> Hi,
> I have a problem.
> i do this:
> file6 = 'E:\DeMarine-DEKO\SARscape-Images
> \TSX1_SAR__GEC_SE___SM_S_SRA_20071122T034336_20071122T034345 \IMAGE_W_SRA_strip_011_W_geo.h6'
>
> openw, lun, file6, /Get_lun
>
> for k = 0, n_elements(xpt)-1 do begin
> if ((xpt[k,0] ge 1 and xpt[k,0] le 15751) and (ypt[k,0] ge 1
> and ypt[k,0] le 12826)) then begin
> printf, lun, 'A:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 15751 and xpt[k,0] le 22501 ) and (ypt[k,0]
> ge 1 and ypt[k,0] le 12826)) then begin
> printf, lun, 'B:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 22501 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 1 and ypt[k,0] le 12826)) then begin
> printf, lun, 'C:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 1 and xpt[k,0] le 6076 ) and (ypt[k,0] ge
> 12826 and ypt[k,0] le 57600)) then begin
> printf, lun, 'D:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 12826 and ypt[k,0] le 17326)) then begin
> printf, lun, 'E:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 17326 and ypt[k,0] le 23626)) then begin
> printf, lun, 'F:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
> if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 23626 and ypt[k,0] le 57600)) then begin
> printf, lun, 'G:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
> endif
>
> endfor
>
> free_lun, lun
>
> nrows1 = File_lines(file6)
>
> EckStruct = {ind:' ', x1: 0L, y1: 0L}
> data1 = Replicate(EckStruct, nrows1)
> openr, lun, file6, /get_lun
> readf, lun, data1
> free_lun, lun
>
> I have tihs error message : 'READF: Input conversion error. Unit:104'
> where are the problem?
> Can somebody help me?
>
> thank you in advance
> Woods
I think you need a format for readf, to specify how wide the string in
the first field is. The default, which is being used above, is to
assume that the string goes to the end of the line, so it is
incorporating what should be x1 and y1 into ind. Or you could change
the way the file is written and read so that the string field comes
last in the line.
|