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 
Return to the default flat view 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.
[Message index]
 
Read Message
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: Fri Oct 10 09:00:52 PDT 2025

Total time taken to generate the page: 1.27722 seconds