Link to home
Start Free TrialLog in
Avatar of xbox360dp
xbox360dp

asked on

Removing file extension within a file.

Gurus,

I need a script that will search through file and remove the any ".tmp" extension it finds.
Before Example:
xxx.log
Transfer file: csm_itemmaster_20150811115313.csv.tmp*****

After Example:
xxx.log
Transfer file: csm_itemmaster_20150811115313.csv*****

Any help would be appreciated :)
Avatar of Michael Chisholm
Michael Chisholm
Flag of United States of America image

In a batch file type:

Echo off
Rem change information in quotes and remove " 
Rem (point to the drive you want)

cd "c":

Rem (point to the directory you want)

cd "filesfolder"

Rem  This will search an entire folder and rename those that match

ren *."tmp"  *."cmd"

exit
Avatar of Bill Prew
Bill Prew

Do you want to change the name of the file, or a file name that is in the contents of a file?

~bp
Avatar of xbox360dp

ASKER

I want to change the file name in the contents of the file not the file name itself.
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial