How to supress output from going to new line [message #91106] |
Thu, 04 June 2015 01:58  |
vaibhavpant55
Messages: 10 Registered: December 2014
|
Junior Member |
|
|
HI,
I am trying to print some long integers, double values in a file using PRINTF command but in the file some values are pushed to next line. Does anyone has any idea how to suppress it from jumping to new line?
IDL> openw,3,'test.txt'
IDL> printf,3,10.d,9.d,10.d,10.d,10.d,10.d,20.098d,15.d,17.d,2.d, 18.d,34.d IDL> close,3
============================================================ =================
OUTPUT
10.000000 9.0000000 10.000000 10.000000 10.000000
10.000000 20.098000 15.000000 17.000000 2.0000000
10.000000 9.0000000 10.000000 10.000000 10.000000
10.000000 20.098000 15.000000 17.000000 2.0000000
18.000000 34.000000
============================================================ =================
After every 5 elements next elements jumps to a new line. I want all values to be in one line only.
Any ideas?
Vaibhav
|
|
|
Re: How to supress output from going to new line [message #91109 is a reply to message #91106] |
Thu, 04 June 2015 07:12   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Vaibhav Pant writes:
> I am trying to print some long integers, double values in a file using PRINTF command but in the file some values are pushed to next line. Does anyone has any idea how to suppress it from jumping to new line?
>
> IDL> openw,3,'test.txt'
> IDL> printf,3,10.d,9.d,10.d,10.d,10.d,10.d,20.098d,15.d,17.d,2.d, 18.d,34.d IDL> close,3
>
> ============================================================ =================
> OUTPUT
> 10.000000 9.0000000 10.000000 10.000000 10.000000
> 10.000000 20.098000 15.000000 17.000000 2.0000000
> 10.000000 9.0000000 10.000000 10.000000 10.000000
> 10.000000 20.098000 15.000000 17.000000 2.0000000
> 18.000000 34.000000
>
> ============================================================ =================
> After every 5 elements next elements jumps to a new line. I want all values to be in one line only.
> Any ideas?
Use a FORMAT statement and an appropriate WIDTH for your output.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: How to supress output from going to new line [message #91114 is a reply to message #91109] |
Thu, 04 June 2015 22:07  |
vaibhavpant55
Messages: 10 Registered: December 2014
|
Junior Member |
|
|
On Thursday, June 4, 2015 at 7:42:53 PM UTC+5:30, David Fanning wrote:
> Vaibhav Pant writes:
>
>> I am trying to print some long integers, double values in a file using PRINTF command but in the file some values are pushed to next line. Does anyone has any idea how to suppress it from jumping to new line?
>>
>> IDL> openw,3,'test.txt'
>> IDL> printf,3,10.d,9.d,10.d,10.d,10.d,10.d,20.098d,15.d,17.d,2.d, 18.d,34.d IDL> close,3
>>
>> ============================================================ =================
>> OUTPUT
>> 10.000000 9.0000000 10.000000 10.000000 10.000000
>> 10.000000 20.098000 15.000000 17.000000 2.0000000
>> 10.000000 9.0000000 10.000000 10.000000 10.000000
>> 10.000000 20.098000 15.000000 17.000000 2.0000000
>> 18.000000 34.000000
>>
>> ============================================================ =================
>> After every 5 elements next elements jumps to a new line. I want all values to be in one line only.
>> Any ideas?
>
> Use a FORMAT statement and an appropriate WIDTH for your output.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Thanks, I set width=1000 with openw command and it worked...
|
|
|