Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Writing an array of a structure to a file
PV-Wave 3.1, Sun 4. I've got an array of a structure which must be sorted and duplicate entries deleted. Since PV-Wave's sort can only handle simple arrays (not structures), I want to dump the array structure to an ascii file and use Unix sort on it. However, since the array is large (up to 5000 elements), I don't want to use a "for" loop. What is want to do is say: writef, unit, catlg_sta, format='(7a,3i10)' where structure is defined as: catlg_stru = {catlg, a:' ', b:' ', c:' ', e:' ', f:' ', $ d_st:' ', d_ed:' ', jul_st:0L, jul_ed:0L, dssfile:0L} catlg_sta = replicate({catlg}, 5000) However, curiously each tag field of each array element is put on its own line. And stranger, it doesn't seem to make a lot of difference just what the format is! A format of '(a)' produces the same result. Free format is no good, as it decides itself where line breaks occur; not good for subsequent sorting. Any ideas how I can get each array element on its own line? -- Ralph Finch 916-653-8268 rfinch@water.ca.gov ...ucbvax!ucdavis!caldwr!rfinch Any opinions expressed are my own; they do not represent the DWR