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

Home » Public Forums » archive » Re: simple FORMAT question for the experts
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
Re: simple FORMAT question for the experts [message #61223] Thu, 10 July 2008 13:55
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 10, 3:25 pm, "Ryan." <rchug...@brutus.uwaterloo.ca> wrote:
>> This article might help:
>
>>   http://www.dfanning.com/tips/csv_file.html
>
> Thanks David,
>
> I guess I cannot do it without first determining the length of the
> list and adding it in to the string. =(
>
> Ryan.

Have you tried (or do you want) STRJOIN?
Re: simple FORMAT question for the experts [message #61226 is a reply to message #61223] Thu, 10 July 2008 13:25 Go to previous message
Ryan. is currently offline  Ryan.
Messages: 77
Registered: March 2006
Member
> This article might help:
>
>   http://www.dfanning.com/tips/csv_file.html
>

Thanks David,

I guess I cannot do it without first determining the length of the
list and adding it in to the string. =(

Ryan.
Re: simple FORMAT question for the experts [message #61228 is a reply to message #61226] Thu, 10 July 2008 13:12 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ryan. writes:

> I know this is a simple question for some, but for me who has not yet
> become a master in formatting syntax I can't seem to get it right. I
> am outputting a large number of files and on one line of those files,
> I output a list of string values. The challenging part is that for
> each file the list changes so the number of elements with a comma
> separating each one and I would like to have one consistent format
> string (if possible). I know I can combine strings with the number of
> elements of the array but prefer not to go that route.
>
> Here is a sample:
> array = ['a','b','c','d','e']
> print, 1S, 'Text', array, FORMAT='(I02, " ", A0, " :", A0, :, ",")'
>
> I want this as a result:
> 01 Text :a,b,c,d,e
>
> But I get this:
> 03 Text :a,
> 00 b :c,
> 00 d :e
>
> Can anyone suggest where I'm going wrong?

This article might help:

http://www.dfanning.com/tips/csv_file.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Benchmark Page?
Next Topic: iVector -- Plotting wind barbs

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

Current Time: Wed Oct 08 18:07:12 PDT 2025

Total time taken to generate the page: 0.00469 seconds