comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Text output line too short, width = val not working
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Text output line too short, width = val not working [message #91105] Wed, 03 June 2015 17:21 Go to previous message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Hi,

I'm writing an ascii file of data and some of the numbers are wrapping to a second line. On a couple of web pages, I find a suggested solution of adding width = somevalue to the end of my openw statement. I tried several different values, all the way up to 400, and found no change in my output. Any idea why this is? The relevant code and output lines are below. Interestingly, the header line (just text) prints out fine regardless of whether I use a width parameter.

Code lines:

openw, 4, outname + '.txt', width = 400
printf, 4, ' Date DOY Time SZA Lat. Lon. Mask Type CF Height Pressure Temp Tau LWP r_e R_650 R_3.75 T_650 T_3.75'
printf, 4, format = '(I4, 1X, 2(I3, 1X), I4, 1X, (A4, 1X), 2(F7.2, 1X), F7.2, 1X, 2(I4, 1X), F8.3, 1X, F8.3, 1X, F6.1, 1X, F6.1, 1X, F7.2, 1X, F7.2, 1X, F6.1, 2(1X, F7.2))', year, month, day, doy, time, outdata


Example lines:

Date DOY Time SZA Lat. Lon. Mask Type CF Height Pressure Temp Tau LWP r_e R_650 R_3.75 T_650 T_3.75

2015 2 3 34 2345 -999.00 -999.00 -999.00 -999 -999 -999.000 -999.000 -999.0 -999.0 -999.00 -999.00 -999.0 -999.00 -999.00
-999.00 -999.00

2015 2 4 35 0015 38.54 -121.39 77.95 3 7 0.996 10.000 277.2 224.6 -999.00 -999.00 -999.0 26.75 27.24
282.35 268.82


(If you can't see that properly in this window, only the last two numbers in each of the data "lines" is on a new line.) The crazy format statement comes from me trying to make the line as short as possible.

Thanks,

Laura
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL v8 not recognizing bash environment variable
Next Topic: How to supress output from going to new line

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:23:00 PDT 2025

Total time taken to generate the page: 0.00515 seconds