Questions tagged [batch-rename]

Batch renaming is a form of batch processing used to rename multiple computer files and folders.

Batch renaming is a form of batch processing used to rename multiple computer files and folders in an automated fashion, in order to save time and reduce the amount of work involved. Some sort of software is required to do this. Such software can be more or less advanced, but most have the same basic functions. Batch renaming software exists for most operating systems.

Reference: Wikipedia

924 questions
4
votes
3 answers

Python: How to replace whitespaces by underscore in the name of ALL files, folders and subfolders?

How can we replace the whitespaces in the names of folders, subfolders and files in a given parent folder? My initial attempt to replace up to level 8 is given below. I am sure there are better ways. My code looks ugly. Better solutions are more…
BhishanPoudel
  • 15,974
  • 21
  • 108
  • 169
4
votes
3 answers

How can I add a prefix to all filenames under a directory?

I am trying to prefix a string (reference_) to the names of all the *.bmp files in all the directories as well sub-directories. The first time we run the silk script, it will create directories as well subdirectories, and under each subdirectory it…
Anil
  • 3,912
  • 5
  • 35
  • 46
4
votes
1 answer

Generate file-folder list.txt file in a directory/subdirectory & rename list.txt to folder/subfolder name using dir & ren command in a batch file

I am trying to : list contents of each folder in a subfolder in a text file, place the text file in parent folder as well as subfolder, rename the output text file as name of parent folder/subfolder. To achieve that I have tried following batch…
manaswin
  • 41
  • 5
4
votes
2 answers

PHP: How to rename folders

I'd like to ask you for a one small thing. I have a few another folders in a main folder. This sub-folders are named: v1, v2, v3, v4... I would like to know, when I delete one of these folders, e.g. v2 -> so I have v1, v3, v4 how to rename all…
chudst
  • 139
  • 3
  • 12
4
votes
1 answer

Delete all leading whitespace of folder/file names

I've built a command to delete all leading whitespace of all folder/file names in a directory (with subdirectories). find /dir/* -depth -execdir rename 's/^\s+//g' * "{}" \; It works in some small directories (with some subdirectories) but it took…
Dice
  • 41
  • 2
4
votes
2 answers

Adding sequential numbers to the end of file names - Shell Script

I am trying to add sequential four digit numbers to the end of file names during a rename script. The problem I am running into is that it only pads the first file and the numbers added are not sequential. Here is my script so far: Starting file…
VanCityGuy
  • 117
  • 1
  • 7
4
votes
2 answers

Search file names of specific extensions and remove special characters

I am trying to write a patch file that will do the following: Search w:\ for all *.pdf and *.xls files. There are many directories and sub-directories to search. I need to search the file name and replace the following. Not every file name will…
CCurrell
  • 41
  • 2
4
votes
1 answer

How to rename all files and folder containing underscore to hyphen in Linux

I want to rename all files and folder containing underscore in name and replace underscore with hyphen. Currently I am using following code, rename '_' '-' */*/* It was working but now it is showing me "Argument list too long"
Vishal Barot
  • 39
  • 1
  • 4
4
votes
2 answers

OSX: change date format in multiple file names

I have a large number of files in this format (iPhone camera): Photo 31-12-13 12 59 59.jpg How can I batch rename these files using the OSX command line to this (ISO) format: 2013-12-31 12 59 59.jpg I have tried using the command below, but it…
4
votes
5 answers

how to change the extension of multiple files using bash script?

I am very new with linux usage maybe this is my first time so i hope some detailed help please. I have more than 500 files in multiple directories on my server (Linux) I want to change their extensions to .xml using bash script I used a lot of codes…
unique_programmer
  • 1,561
  • 3
  • 11
  • 14
3
votes
1 answer

Avoiding file renaming duplication in Linux bash script when rerun

I have 100 directories from data001 to data100 in my Linux system, and I want my bash script to rename all the data files with different extensions according to their directory names. For example, files in directory data001should be renamed as…
Mark
  • 35
  • 4
3
votes
2 answers

What is the DOS search pattern expression to find files named "Main" with any integer extension?

I have a program that generated unknown numbers of files with integer extension as follows. I want to append .eps to each. How to do this in a DOS batch file? I cannot use the following because I don't know the search expression. for %%x in…
Second Person Shooter
  • 14,188
  • 21
  • 90
  • 165
3
votes
2 answers

Rename files using Regex on Mac Terminal

I'm trying to rename files in a folder which has files with a name like: ['A_LOT_OF_TEXT'].pdf&blobcol=urldata&blobtable=MungoBlobs I basically want to obtain everything before the '.pdf' including the '.pdf' After install brew rename, I tried…
3
votes
2 answers

.bat for batch rename to increment numbers in fname

I have a large folder of .cbr's, and I'm renaming them by issue number to correctly order them. What do I need to include in the ren line to have each file increment the number in the file name via windows command prompt? I'll be doing this…
werdnanoslen
  • 102
  • 4
  • 7
  • 22
3
votes
2 answers

Error with Powershell add suffix to filenames based on prefix

So I have a list of files in a folder in jpg format like so: "1.George ABCD.jpg" "2.George ABCD.jpg" "3.Mead ABCD.jpg" So what I want to do is rename them so that the the prefix becomes a suffix like so: "George ABCD 1.jpg" "George ABCD…
John Smith
  • 333
  • 2
  • 3
  • 9
1 2
3
61 62