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