There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow software sound trojan usb video virus vista windows windows xp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Daily file Renaming


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
smartcard's Avatar
Member with 45 posts.
 
Join Date: Jun 2007
21-Jun-2007, 11:52 AM #1
Daily file Renaming
I have a daily file from my system that comes like the following:

ttx_export_20070622.txt
ttx_export_20070621.txt
ttx_export_20070620.txt

As you can see the above 3 files for 3 days 20th, 21st and 22nd June 2007.

I need a BAT file or any tool that can automatically rename these files as follows:

0120070622.txt
0120070621.txt
0120070620.txt

What I am doing now is replacing the text "ttx_export_" with "01"

How can I achieve it?

Thank you.
gdi1942's Avatar
Senior Member with 191 posts.
 
Join Date: Nov 2006
Experience: Advanced
27-Jun-2007, 06:40 PM #2
Ifyou don't need it done by batch or DOS I might be able to do something in java for ya. my dos is kinda limited, but if you know anything about dos the FINDSTR command line app would be benificial in this.
JohnWill's Avatar
Computer Specs
Moderator with 78,896 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
Experience: Advanced age & experience
28-Jun-2007, 12:11 PM #3
I'm lazy, so I'd use something like AutoIt to build a simple command to do this trick.
ghostdog74's Avatar
Member with 94 posts.
 
Join Date: Dec 2005
28-Jun-2007, 10:34 PM #4
you can do your own scripting. here's a vbscript
Code:
Dim newName,pattern,newPattern,objFSO
Set objFSO= CreateObject("Scripting.FileSystemObject")
Set colFolders = objFSO.GetFolder("C:\\temp")
pattern="ttx_export_"
newPattern="01"
For Each oFile In colFolders.Files    
    If InStr(1,oFile.Name,pattern,1) > 0 Then
    	newName=Replace(oFile.Name,pattern,newPattern)    	
    	oFile.Name= newName    	
    End If
Next
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:51 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.