<div dir="ltr"><div>Hi Fangfei,</div><div><br></div><div><div>> I want to have file name like </div><div>> image_xy0000_c0_t00.tiff, i.e.,4 digits for series,</div><div>> 1 digit for channel, and two digit for time.</div></div><div><br></div><div>Here is a little shell script:</div><div><br></div><div><div>for f in *.tiff</div><div>do</div><div> s1="${f#*_xy}"</div><div> s2="${f#*_c}"</div><div> s3="${f#*_t}"</div><div> prefix="${f%%_xy*}"</div><div> ext="${f##*.}"</div><div> xy="$(printf "%05d" ${s1%%_*})"</div><div> c="$(printf "%05d" ${s2%%_*})"</div><div> t="$(printf "%05d" ${s3%%.*})"</div><div> echo "${prefix}_xy${xy}_c${c}_t${t}.$ext"</div><div>done</div></div><div><br></div><div>Tweak it to ensure it works for you, then when ready, change the "echo" line to:</div><div><div><br></div><div> mv "$f" "${prefix}_xy${xy}_c${c}_t${t}.$ext"</div></div><div><br></div>The script I use to remember this stuff is here:<div> <a href="https://github.com/ctrueden/ctr-scripts/blob/master/using.sh">https://github.com/ctrueden/ctr-scripts/blob/master/using.sh</a><br></div><div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 5:13 PM, FangfeiLi <span dir="ltr"><<a href="mailto:lifangfei@hotmail.com" target="_blank">lifangfei@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Curtis,</div><div><br></div>Thank you so much for your reply.<div><br></div><div>Actually, the situation is a little more complicated.</div><div><br></div><div>What I can get image by using bfconvert is like</div><div><br></div><div>image_xy0_c0_t0.tiff (image_xy%s_c%c_t%t.tiff),….</div><div><br></div><div>But I want to have file name like </div><div>image_xy0000_c0_t00.tiff, i.e.,4 digits for series, 1 digit for channel, and two digit for time.</div><div><br></div><div>It seems that the command following can only change one part at a time.</div><div><br></div><div> "for f in name*; do mv "$f" "name$(printf "%05d\n" "${f#*name}")"; done”</div><div><br></div><div>I am not quiet familiar with the shell language.</div><div><br></div><div>Is that possible that you give me some hint on how doing it?</div><div><br></div><div><br></div><div>Thank you so much and best regards!</div><div>Fangfei</div><div><div class="h5"><div><br></div><div><div dir="ltr"><div><br></div></div></div><div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div>On Dec 5, 2014, at 1:20 PM, Curtis Rueden <<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>> wrote:</div><br><div><div dir="ltr">Hi Fangfei,<div><br></div><div>> <span style="font-size:13px">Unfortunately, there isn't a way to do this at the moment.</span></div><div><span style="font-size:13px"><br></span></div><div>In the meantime, you could simply rename the resultant files afterwards:</div><div><br></div><div> for f in name*; do mv "$f" "name$(printf "%05d\n" "${f#*name}")"; done<br></div><div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 11:58 AM, Melissa Linkert <span dir="ltr"><<a href="mailto:melissa@glencoesoftware.com" target="_blank">melissa@glencoesoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Fangfei,<br>
<span><br>
> I have a question. When using the bfconvert to transfer file from nd2 to tiff, can I save the file name like<br>
> name0001<br>
> name0002<br>
> …<br>
> name0010<br>
> name0012<br>
> …<br>
><br>
> instead of<br>
><br>
> name1<br>
> name2<br>
> …<br>
> name10<br>
> name12<br>
><br>
> when using %s?<br>
<br>
</span>Unfortunately, there isn't a way to do this at the moment. However, I have<br>
opened a ticket on our issue tracking system for this:<br>
<br>
<a href="http://trac.openmicroscopy.org/ome/ticket/12678" target="_blank">http://trac.openmicroscopy.org/ome/ticket/12678</a><br>
<br>
You will be automatically notified of updates to the ticket - just let<br>
us know if you prefer not to receive updates.<br>
<br>
Regards,<br>
-Melissa<br>
<div><div><br>
<br>
On Thu, Dec 04, 2014 at 09:56:23PM -0500, FangfeiLi wrote:<br>
> Hi,<br>
> I have a question. When using the bfconvert to transfer file from nd2 to tiff, can I save the file name like<br>
> name0001<br>
> name0002<br>
> …<br>
> name0010<br>
> name0012<br>
> …<br>
><br>
> instead of<br>
><br>
> name1<br>
> name2<br>
> …<br>
> name10<br>
> name12<br>
><br>
> when using %s?<br>
><br>
> Thank you very much and best regards!<br>
> Fangfei<br>
> _______________________________________________<br>
> ome-users mailing list<br>
> <a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.openmicroscopy.org.uk</a><br>
> <a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
_______________________________________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk" target="_blank">ome-users@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users</a><br>
</div></div></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>