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

Home » Public Forums » archive » How to supress output from going to new line
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How to supress output from going to new line [message #91106] Thu, 04 June 2015 01:58 Go to next message
vaibhavpant55 is currently offline  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 Go to previous messageGo to next message
David Fanning is currently offline  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 Go to previous message
vaibhavpant55 is currently offline  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...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Text output line too short, width = val not working
Next Topic: Vertical text orientation?

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

Current Time: Wed Oct 08 11:28:54 PDT 2025

Total time taken to generate the page: 0.00590 seconds