I have 5000 files in the folder. I have a text file with 5000 names, one on each line. How can i mass rename these files so that each file gets a name from each line? This has been a pain in the back for me. None of the software i tried can do it and there are thousands of renaming applications out there! Any suggestions? Thank you!
files on linux server or on windows desktop pc? if desktop, simple VB code Private Function RenameFolderFromFile(ByVal fldname As String, ByVal filname As String) As Boolean Dim s As String = "" Try Dim freader As New System.IO.StreamReader(filname) For Each fld As System.IO.FileInfo In My.Computer.FileSystem.GetDirectoryInfo(fldname).GetFiles If freader.EndOfStream Then MsgBox("Not enough filenames in renamefile") Exit For Else s = freader.ReadLine End If My.Computer.FileSystem.RenameFile(fld.FullName, s) Next freader.Close() Catch ex As Exception Return False End Try Return True End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click RenameFolderFromFile("c:\fold", "c:\rename.txt") End Sub Code (markup): if linux server do the same with php/perl/bash