Re: tab delimited text files [message #8929] |
Fri, 09 May 1997 00:00 |
agraps
Messages: 35 Registered: September 1994
|
Member |
|
|
jones@mpipsykl.mpg.de (Richard Jones) writes:
> I now need to generate data for
> a programme which requires tabs between the data columns, can anyone
> enlighten me as to how I can do this using printf (or other IDL routines
> if necessary). By the way I am using antiquated IDL 4.01.
It is such a common usage thing, there should be an example in the IDL
manuals, but I've never seen one.
tabchar = STRING(9B) ;This defines the tab character (to
;put in output between vars)
Then you could cycle through an array (call it 'row' of length 5) and
print the values with a format:
form = '$(E10.4)'
textfl= ''
FOR i = 0, 4 DO BEGIN
textfl = textfl + STRING(FORMAT = form, row(i))
textfl = textfl + tabchar
END ;FOR i
PRINTF, lun, textfl
You'll have an extra tab at the end of your row, but this is one way
to automatically print tab-delimited values to an ascii file.
Amara
--
************************************************************ *************
Amara Graps email: agraps@netcom.com
Computational Physics vita: finger agraps@best.com
Multiplex Answers URL: http://www.amara.com/
************************************************************ *************
|
|
|