Printf and line breaks [message #23244] |
Fri, 19 January 2001 11:52 |
s007amf
Messages: 8 Registered: January 2001
|
Junior Member |
|
|
Sorry to bother everyone again. I am just beginning my enduring journey of
learning IDL and keep running into obstacles.
My current problem is with printf. I am trying to create a text output
file that can be imported into a spreadsheet. My problem is that printf is
automatically line wrapping. For example:
printf, filetpr, val1, val2, val3, val4, val5, val6,
is producing output where val1, val2, val3, and val4 are on a single line.
But, val5 and val6 are placed on the following line. NOTE: I am actually
trying to print 10 different floats on the same line.
I did think about converting all the values into one long string and
printing that string. But, this issue was still a problem.
Anyone have any ideas about how to fix this? Is a solution even possible?
Thanks,
Alan
|
|
|
Re: Printf and line breaks [message #23245 is a reply to message #23244] |
Fri, 19 January 2001 11:13  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
ALAN FRAZIER (s007amf@news.wright.edu) writes:
> Sorry to bother everyone with another question. But, I am just at the
> beginning of the enduring process of learning IDL.
Yeah, you and me, both. :-)
> My current problem is with printf. I am trying to create a text output
> file that can be easily imported into a spreadsheet. From what I can
> tell, printf automatically line wraps after 80 or so characters. For my
> output, I want printf to print everything on the same line. I am
> wondering if anyone knows how to do this or if this is even possible?
When you open the file for writing, set the WIDTH keyword to
as wide a line as you need. 80 columns is the default
for historical reasons. (Are you old enough to remember
punch cards?)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|