Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > Software & Technology
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-18-2019, 11:40 PM
1695814's Avatar
1695814 1695814 is offline
Member
SOA AAA
 
Join Date: Aug 2002
Studying for nothing. I quit.
Favorite beer: Root
Posts: 36,316
Default mass file rename in windows explorer

I don't remember the circumstances, but on or about October 30 of 2018 all of the files on my computer had "(2018_10_30 20_41_34 UTC)" appended onto their names.



So, what should be "NFL Schedule 2018.xlsx" is showing as "NFL Schedule 2018 (2018_10_30 20_41_34 UTC).xlsx"


What should be "turkey.gif" is showing as "turkey (2018_10_30 20_41_34 UTC).gif"


There are hundreds, perhaps thousands, of files that were renamed, and there are numerous file extensions involved. Of course, not every file has this issue.



Is there a utility of some sort that can help me rename them (drop the "(2018_10_30 20_41_34 UTC)" from each)?


I'm thinking perhaps I could get a list of all of the files that have this misnaming, put them in an excel spreadsheet & run some sort of macro to do the work for me.



Here's a macro that I probably got from someone around here that copies a list of files from one place to another:
Code:
Sub Copy_files_over()

Dim i As Integer
Dim NewFilesRange As Range
Dim OldFilesRange As Range

Set NewFilesRange = Sheets("FileList").Range("NewFiles")
Set OldFilesRange = Sheets("FileList").Range("OldFiles")
    
'For each file in your list, copy the old file from the old directory
' to the new directory & give it a new name
For i = 1 To NewFilesRange.Rows.Count
'Only copy it over if the new file does not already exist
 If Len(Dir(NewFilesRange.Cells(i).Value)) = 0 Then
  FileCopy OldFilesRange.Cells(i).Value, _
           NewFilesRange.Cells(i).Value
 End If
Next i
Range("b2:d2").Select
End Sub
I imagine it just needs some tweaking to rename instead of copy, but I don't really know how to do that.


So, I need two things:
  1. How to get a list of affected files
  2. How to tweak or rewrite that macro to rename them
Thanks for reading & TIA,
###
Reply With Quote
  #2  
Old 05-19-2019, 08:09 AM
Incredible Hulctuary's Avatar
Incredible Hulctuary Incredible Hulctuary is offline
Member
Non-Actuary
 
Join Date: Jan 2002
Posts: 26,007
Default

I haven't tried it myself, but this utility appears to be able to do what you want: https://www.advancedrenamer.com/
__________________
The forest was shrinking, but the trees kept voting for the axe because its handle was made from wood, and they thought it was one of them.
Reply With Quote
  #3  
Old 05-19-2019, 04:14 PM
1695814's Avatar
1695814 1695814 is offline
Member
SOA AAA
 
Join Date: Aug 2002
Studying for nothing. I quit.
Favorite beer: Root
Posts: 36,316
Default

Quote:
Originally Posted by Incredible Hulctuary View Post
I haven't tried it myself, but this utility appears to be able to do what you want: https://www.advancedrenamer.com/
Excellent. Yes, it worked quite well. Thanks for that.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 09:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.12909 seconds with 11 queries