incrementing number added to directory
- From: "Niv (KP)" <kev.parsons@xxxxxxxxxx>
- Date: 30 Aug 2005 06:41:03 -0700
I want to build a directory structure with an incrementing number
of between 01 & 99, but I want the number 1 to 9 to be precede by the
0, so all directories have a 2 digit number as part of the name.
The below works, but only gives 1 to 9 then 10 to 99 not 01 to 99.
Anyone help please? I've tried format string etc, but not quite
getting there.
This keeps the directory listing in correct order, rather than 1, 10,
11, 2, 3 etc.
#-------------------------------------------------------------
# initialise the module testbench directory counter.
set n 00
set uscore _
# Create the test bench directory for each module.
foreach entry $modules {
incr n
foreach bench_dir {FRED PETE KEV SIMON} {
set longname [set n][set uscore][set entry]
file mkdir $tbench_path/BENCH_ML_$longname/$bench_dir
}
}
#-------------------------------------------------------------
.
- Follow-Ups:
- Re: incrementing number added to directory
- From: suchenwi
- Re: incrementing number added to directory
- Prev by Date: Re: writing to a starpack
- Next by Date: Re: incrementing number added to directory
- Previous by thread: XPM to be used as Bitmaps or Images ?
- Next by thread: Re: incrementing number added to directory
- Index(es):