String Formatting [message #64823] |
Mon, 26 January 2009 11:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
Before I re-invent the wheel, I thought I would ask.
I wish to write an ASCII text file with two columns of
text. The first column should be 30 characters wide,
the second column should be 45 characters wide.
BUT, I wish the data in the columns to be *left*
justified, not right justified.
What trick to you use, or what formatting string will
give me this kind of output?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: String Formatting [message #64918 is a reply to message #64823] |
Mon, 26 January 2009 15:15  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Marshall Perrin writes:
> If it makes you feel any better, I wrote my own left-justifier a
> couple months back, being likewise unable to find that format
> code anywhere in the documentation. Now to go rip it out and
> replace it with a '-' ...
I haven't gotten rid of the darn thing, because it seems
to me there ought to be a use for it somewhere. Probably
where you are making lists of things in a widget, and you
want the list left justified...
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: String Formatting [message #64919 is a reply to message #64823] |
Mon, 26 January 2009 14:27  |
Marshall Perrin
Messages: 44 Registered: December 2005
|
Member |
|
|
David Fanning <news@dfanning.com> wrote:
> Lajos writes:
>
>> try '-' in the format:
>
> Ah, I had a feeling that was there somewhere! Thanks. :-)
If it makes you feel any better, I wrote my own left-justifier a
couple months back, being likewise unable to find that format
code anywhere in the documentation. Now to go rip it out and
replace it with a '-' ...
- Marshall
|
|
|