
Thanks Alex K for editing my original post (my first post) and thanks foxidrive for your recomendation and KnightWhoSayNi sharing your way. If it can't be easily done in Batch file, I'd try to find something in PowerShell.
#Mass rename files to listfile how to#
txt Example: How to change/delete prefix of files ls a1.txt a2.txt a3.txt. Ideally, I'd have a batch file in the Database folder that renames the files that remove Table, StoredProcedure, View and Function from the name of the files in their respective folders. sudo apt-get install rename How to use rename: rename used regular expressions to match filenames and change them, the general format of the command is: rename 'regex' files Example: how to change the file extension rename 's/.txt/.txtback/'. This will change the first file to a field so you can type the new file name. The files under the Tables folder would then be renamed to: Īnd the name of files under the Stored Procedures folder would then be: dbo.usp_StoredProcedure1Name.sql After testing, remove -n to actually rename files. Select Home > Rename from the Organize group in the ribbon.


Under the Stored Procedures folder: dbo.usp_ĭbo.usp_ĭbo.usp_ There will lots of files in each of the Tables, Stored Procedures, Views and Functions folders of the following format: The listFiles () method is a part of File class.The function returns an array of Files denoting the files in a given abstract pathname if the path name is a directory else returns null. I have the following folders structure: C:\Database
