Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

padding numbers in front of uniquely generatd names

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

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"}]] ]

or 

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

sean


  • 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