|
[Date Index]
[Thread Index]
[Author Index]
Re: Question about filenames for Export[...]
- To: mathgroup at smc.vnet.net
- Subject: [mg99792] Re: Question about filenames for Export[...]
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Thu, 14 May 2009 02:04:54 -0400 (EDT)
On 5/13/09 at 5:09 AM, szhorvat at gmail.com (Szabolcs Horv=C3=A1t) wrote:
>I'd also like to know if there is a "neat" way to achieve this. The
>way I've been using was not that pretty ...
>makeFileName[i_Integer] :=
>"prefix" <> ToString@PaddedForm[i, 4, NumberPadding -> "0"]
I typically use NumberForm rather than PaddedForm. But I don't
think this difference would meet your criteria for "neat"
>What I hate about this is that it adds an extra zero ... See what
>makeFileName[12345] outputs.
There is an "extra" space associated with positive numbers which
is replace by zero. Since this always happens for positive
numbers, there is a simple way to get rid of the extra zero.
Changing your function above to:
makeFileName[i_Integer] :=
"prefix" <> StringDrop[ToString@PaddedForm[i, 4, NumberPadding
-> "0"],1]
or
makeFileName[i_Integer] :=
"prefix" <> StringTake[ToString@PaddedForm[i, 4, NumberPadding
-> "0"],-4]
will get rid of the extra zero.
Prev by Date:
Re: Assign new values to matrix using indices
Next by Date:
Re: GuiKit, seeking some guidance and comments
Previous by thread:
Re: Question about filenames for Export[...]
Next by thread:
Re: Question about filenames for Export[...]
|