Re: How to rip off the brackets when writing STRUCTURE into file in a whole? [message #62684] |
Thu, 25 September 2008 12:39 |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
ZuYing wrote:
> Dear all,
>
> I try to write a structure into a file but the free format will
> preserve the annoying brackets, and since each input is for different
> structures of unknown type, I can not write a specific format for it
> to input line by line. Any suggestions to write structures into a data
> file without brackets hanging around?
>
> Cheers,
>
> Ying
Hi,
not sure if this is the best way of doing it or not, but it works:
a = {a:0,b:'bb'}
b = string(a,/print)
now, if your structure does NOT contain any other structure, just remove
the first and last character of the b string (the {})
If you do have sub-structures, search and replace every occurrence of {
and }!
then, write b to your file!
Jean
|
|
|