Renumber files: Difference between revisions

Jump to navigation Jump to search
58 bytes added ,  10 December 2010
no edit summary
(Created page with 'Let's say you have a list of images named something_###.img with ### spanning 381-560, and you want to renumber them to be from 1 to 180. '''echo | awk '{for(i=1;i<181;i++) prin…')
 
No edit summary
Line 4: Line 4:


will do it.  Notice that "%03d" will make sure that numbers are padded with zeros (and if you need 4 digits total, just use %04d instead).  Also, always pipe it to less first before piping to bash, just to make sure that you are not going to inadvertently delete something.
will do it.  Notice that "%03d" will make sure that numbers are padded with zeros (and if you need 4 digits total, just use %04d instead).  Also, always pipe it to less first before piping to bash, just to make sure that you are not going to inadvertently delete something.
Back to [[Useful_scripts_%28aka_smart_piece_of_code%29]]
67

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu