Page 1 of 1
Posted: Mon Mar 15, 2004 1:07 pm
Is there a way to dynamically pad a filename with zeros to a certain length? For example, I have the following files in a folder:
and I want the to all be 8 digits long like the following:
Is there a way to do this with a filter. I have been trying to do this for the past 3 days and haven't been able to figure it out.
Posted: Tue Mar 16, 2004 5:29 am
i would get the electronic listing of file names from the specified directory.
read the file names (as integers, without the suffix) using a c program
command would fix the file name to append with the needed number of zero's. In this case the total length would be 7 characters long. write it to a file with .bat extension and run it (incase of DOS) with a copy/move/rename command should solve the problem.
Unless you want to use MS Excel and save the 0's as a string instead of a number.
Posted: Tue Mar 16, 2004 1:11 pm
Inside a restrict to filename filter, use a right justify filter to force the width, then replace all spaces with zeroes.
Posted: Fri Mar 26, 2004 6:48 pm
I've done this sort of things with Textpipe via Command line textpipe combo...
Dir "C:\director\of\choice" /b > C:\Dir.txt
The output in the file will be:
You can now make a filter that creates a rename batch script which pads the filenames to 8 characters.
assuming your files are in C:\ root
Ren C:\123.txt 00000123.txt /q