If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Renaming files using a batch script

I receive a file from an external source on my PC each day with the name format:

FILE-01_CSV.yyyymmdd.output.csv

I have a batch script which moves this file to a shared directory. However, my users can't automatically import the file into their database because of the dots in the filename. Is there a simple way to rename the file, keeping the .csv extension but replacing all the other dots in the filename with an underscore? My script runs on NT. Thanks in advance.

That would be fine if I was working with a fixed filename but the filename changes each day (the yyyymmdd being the date). I think that I really need some sort of filename manipulation routine which parses the name of the file coming in to build up the name of the output file.

I receive a file from an external source on my PC each day with the name format:

FILE-01_CSV.yyyymmdd.output.csv

I have a batch script which moves this file to a shared directory. However, my users can't automatically import the file into their database because of the dots in the filename. Is there a simple way to rename the file, keeping the .csv extension but replacing all the other dots in the filename with an underscore? My script runs on NT. Thanks in advance.

Hello,
There is a simple solution for your trouble. I suggest you to try BatchRenameFiles Tool program and you can change pretty much everything you want.