Copying filenames - batch processing

Caporegime
Joined
28 Oct 2003
Posts
32,572
Location
Chestershire
Here's the setup. Windows 8. Two hard disk drives. Contain exactly the same files for backup purposes. However, I've just spent some time correcting the file names on disk 1. I could go and do them on disk 2 but I don't want to as it took ages.

So, is there a way somehow of taking all the filenames of the files in a folder on disk 1 and copying/pasting them to the files on disk 2? All the files are in the same order so there would be no mix up.

You could say it might be easier to copy them again but 600GB over USB2 takes many hours.
 
NM. I did it.

I found a utility called Bulk Rename Utility which supports importing file names via a text file.

So I renamed all the files on disk 2 just as numbers 1 to n.
Then use dir /b >list.txt to get the right file names from disk 1. Then the longest bit is just adding 1, 2, 3, 4, etc. in notepad to the list.txt file and importing that into the utility. Excellent.
 
NM. I did it.

I found a utility called Bulk Rename Utility which supports importing file names via a text file.

So I renamed all the files on disk 2 just as numbers 1 to n.
Then use dir /b >list.txt to get the right file names from disk 1. Then the longest bit is just adding 1, 2, 3, 4, etc. in notepad to the list.txt file and importing that into the utility. Excellent.

I wouldn't even have done that. Import the text document to excel, auto number a column before the filenames, then concatenate and spit the third colum out to a text file!
 
I wouldn't even have done that. Import the text document to excel, auto number a column before the filenames, then concatenate and spit the third colum out to a text file!

I haven't got Excel. I tried it in Google Docs but it's not as flexible. You can only output as Tab delimited or Comma delimited. There are commas in the filename so that is out and I can't find a way to remove the Tab marker in notepad using Find/Replace.
 
I can't find a way to remove the Tab marker in notepad using Find/Replace.

Highlight a tab in notepad and copy it, then do ctrl+h, this will open the search/replace box and then you can paste the tab in what you want to search for and replace with nothing.
 
You may find this useful ... but you wil need Microsoft Excel and abit of knowledge with VBA / Marco's.

Import file listing present in directory with Directory Path

PHP:
Sub Print_Dir_Contents()
   Dim Input_Dir, Print_File As String
   Input_Dir = InputBox("Input the path containing the files you want to list on your worksheet" & Chr(13) & Chr(13) & "for example:C:\My Documents\*.*")
   If Input_Dir = "" Then Exit Sub
   ' If you want only to print a specific file type, you can
   ' substitute the "\*.*" with "*\.xl*"
   ' (for Excel files only) for the directory specified in the
   ' InputBox above.
   Input_Dir = Input_Dir & "\*.*"
   Print_File = Dir(Input_Dir)
   ActiveCell.Select
   Do While Len(Print_File) > 0
       ActiveCell.Value = Print_File
       ActiveCell.Offset(1, 0).Range("A1").Select
       Print_File = Dir()
   Loop
End Sub

Import file listing present in directory without Directory Path

PHP:
Sub Print_Dir_Contents_With_Path()
   Dim Input_Dir, Path, Print_File As String
   Input_Dir = InputBox("Input the path containing the files you want to list on your worksheet" & Chr(13) & Chr(13) & "for example:C:\My Documents\*.*")
   If Input_Dir = "" Then Exit Sub
   ' If you want only to print a specific file type, you can
   ' substitute the "\*.*" with "*\.xl*"
   ' (for Excel files only) for the directory specified in the
   ' InputBox above.
   Path = Input_Dir & "\"
   Input_Dir = Input_Dir & "\*.*"
   Print_File = Dir(Input_Dir)
   ActiveCell.Select
   Do While Len(Print_File) > 0
       ActiveCell.Value = Path & Print_File
       ActiveCell.Offset(1, 0).Range("A1").Select
       Print_File = Dir()
   Loop
End Sub

You can then import this to the bulk renaming application :)
 
Back
Top Bottom