I am trying to enumerate some parsed waves. While I can enumerate them using my counter in a for loop, ie basename_1, basename_2, etc., I'd like to have a leading zero, eg basename_01. Any suggestions of how to best accomplish this?
Variablei for(i=0; i<=3; i+=1) String name sprintf name, "%s_%02d", baseName, i Wave/Z w = $name if(WaveExists(w)) Printf"%s exists\r", name else Printf"%s does not exist\r", name endif endfor End
String baseName
Variable i
for(i=0; i<=3; i+=1)
String name
sprintf name, "%s_%02d", baseName, i
Wave/Z w = $name
if (WaveExists(w))
Printf "%s exists\r", name
else
Printf "%s does not exist\r", name
endif
endfor
End
March 20, 2012 at 04:23 pm - Permalink
March 20, 2012 at 05:14 pm - Permalink