MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

padding numbers in front of uniquely generatd names

  • To: mathgroup at
  • Subject: [mg48286] padding numbers in front of uniquely generatd names
  • From: sean_incali at (sean kim)
  • Date: Fri, 21 May 2004 03:54:34 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

hello group. 

below will do exactly what it';s supposed to do which is generate
unique file names.

StringJoin[Unique["plot"] // ToString, ".jpg"]

I wanted to pad 0's in front of my file names for the purpose of
sorting them in a folder by their names. without the 0's in front they
don't sort right.

i found this in the archive that does sort of what i want to... 

With[{i = 1}, "data-" <> ToString[PaddedForm[i, 3, NumberPadding
->{"0", "0"}]] ]


Table["data-" <> ToString[ PaddedForm[i, 3, NumberPadding -> "0"]],
{i, 0, 20}]

above work fine for making the names upfront then assigning them to
pictures, but what if i wanted to generate them as the algorythm runs.
now i thought this was gonna do it...

StringJoin[ToString[ PaddedForm[ Unique["plot"], NumberPadding ->
{"0", "0"}]], ".jpg"]

but no, above is exactly the same as what I had before. 

Without using Table, or With, how do i change it so that above will
generate unique names with 0's padded?

any thoughts will be most appreciated.

thanks in advance


  • Prev by Date: RE: proof of formula for log(-t) found in Mathematica?
  • Next by Date: Re: Trouble : simple stuffs for beginner
  • Previous by thread: Home Page of Marek Rychlik--> Mathematica creations
  • Next by thread: Re: padding numbers in front of uniquely generatd names