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

Home » Public Forums » archive » printf formatting
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
printf formatting [message #44630] Thu, 30 June 2005 07:30
brian0918 is currently offline  brian0918
Messages: 5
Registered: June 2005
Junior Member
I am using printf in IDL to print data to a file in the following way:

printf,1,format='((1x,3(f3.1,1x)),1x,"\")',data(0:*)

The problem with this is that the number of elements in the data array
isn't always evenly divisible by 3. So, it prints each line fine, but
when it gets to the end of the data array, it just gives up, leaving
the last line incomplete. For example, with 8 elements:

1.1 2.2 3.3 \
4.4 5.5 6.6 \
7.7 8.8

What I need is for the last line to include a space and a \ at the end,
like this:

1.1 2.2 3.3 \
4.4 5.5 6.6 \
7.7 8.8 \


Is there any way to fix this last line?

Thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HDF to ENVI format
Next Topic: how to stop a procedure in idlwave

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

Current Time: Wed Oct 08 19:34:04 PDT 2025

Total time taken to generate the page: 0.00505 seconds