Questions tagged [rename]

For anything regarding renaming. Could be applicable to a wide range of subjects. Should be replaced by a more domain-specific tag if applicable.

Questions regarding renaming one or many files, directories, projects, variables, users, data cells, and version control conflicts arising from renaming should be tagged with rename.

To rename a file means to give an existing file a new name without changing any of its content. In UNIX systems, this is done with the mv command.

Renaming a variable will usually require a find-and-replace edit in existing code.

5438 questions
30
votes
8 answers

windows batch file rename

I have some file such as AAA_a001.jpg, BBB_a002.jpg, CCC_a003.jpg in Windows 7 and I'm trying to use batch to rename these file to a001_AAA.jpg, a002_BBB.jpg, a003_CCC.jpg. Just to swap the content between _. I have been searching for a while, but…
yuchien
  • 1,462
  • 1
  • 12
  • 14
30
votes
15 answers

Can't refactor rename in Eclipse

If I do a refactor rename on something, it tries to do it for a moment but then just reverts it right back to what it was named before. No errors or any indication that something is wrong is shown. I just restarted Eclipse and now it's even worse.…
Mike Dannyboy
  • 462
  • 1
  • 4
  • 13
29
votes
2 answers

In Git, how do I get a detailed list of file changes from one revision to another?

I use a Git repository on my server to version user data files sent to the server. I'm interested in getting a list of changed files between any two revisions. I know about git diff --name-only , but this only gives me a list of file…
Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234
29
votes
9 answers

Rename files to lowercase in Powershell

I am trying to rename a bunch of files recursively using Powershell 2.0. The directory structure looks like this: Leaflets + HTML - File1 - File2 ... + HTMLICONS + IMAGES - Image1 - Image2 - File1 - File2 ... + RTF - File1 …
Ralph
  • 31,584
  • 38
  • 145
  • 282
29
votes
2 answers

git, sure-fire way to move/rename files while keeping the history

I know there are "lots" of existing questions that looks similar, so let me summarize them before asking mine. The answer to Is it possible to move/rename files in git and maintain their history? is, "it is not possible". The conclusion for git…
xpt
  • 20,363
  • 37
  • 127
  • 216
29
votes
2 answers

bash error renaming files with spaces - mv target is not a directory

I'm trying to rename a bunch of files which contain spaces in them, getting rid of the spaces. I thought I found the correct bash command: for f in *.txt; do mv \"$f\" ${f/ /}; done However, this gives the error, "mv: target is not a directory"…
Jim Hines
  • 291
  • 1
  • 3
  • 3
28
votes
5 answers

Rename file in PHPStorm without refactoring

How do I quickly rename a file name without refactoring in PHPStorm? Even after I've just created the file, PHPStorm takes a long time to search through my files for its usage.
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
28
votes
4 answers

Intellij IDEA: Make refactor > Rename not select the whole word

When I press my shortcut to rename a variable (precisely it's the "Main menu" > "Refactor" > "Rename..." shortcut), the entire word is selected. Is it possible to change the behavior so that simply the refactoring is activated and the cursor stays…
BAERUS
  • 4,009
  • 3
  • 24
  • 39
28
votes
11 answers

How to do a mass rename?

I need to rename files names like this transform.php?dappName=Test&transformer=YAML&v_id=XXXXX to just this XXXXX.txt How can I do it? I understand that i need more than one mv command because they are at least 25000 files.
PabloC
28
votes
2 answers

How to rename file by replacing substring using batch in Windows

I want to rename file name like "how-to-rename-file.jpg" to "how-to-reuse-file.jpg" by using a Windows batch file I.e. I only want to replace one or two words in a file name.
Varun
  • 501
  • 2
  • 6
  • 12
27
votes
1 answer

How do I rename an R object?

I'm using the quantmod package to import financial series data from Yahoo. library(quantmod) getSymbols("^GSPC") [1] "GSPC" I'd like to change the name of object "GSPC" to "SPX". I've tried the rename function in the reshape package, but it only…
Milktrader
  • 9,278
  • 12
  • 51
  • 69
27
votes
6 answers

rename class with file name in one step in Visual Studio

I am a long year Java programmer, but currently I code in C#. I am accustomed, that when I change filename, also the class name changes and vice versa. This doesn't work in my Visual Studio. I must rename the class name and file name separately, and…
xMichal
  • 624
  • 2
  • 7
  • 19
27
votes
3 answers

PHP Rename File name if Exists Append Number to End

I'm trying to rename the file name of an image when it's uploaded if it exists, say if my file name is test.jpg and it already exists I want to rename it as test1.jpg and then test2.jpg and so on. With the code I've written its changing my file name…
user2201765
  • 1,017
  • 6
  • 18
  • 21
27
votes
2 answers

Remove whitespaces from filenames in Linux

I have hundreds of jpg files in different folders like this: 304775 105_01.jpg 304775 105_03.jpg 304775 105_05.jpg 304775 105_07.jpg 304775 105_02.jpg 304775 105_04.jpg 304775 105_06.jpg Basically, I need to remove the SPACES. I already know the…
Sam Timalsina
  • 457
  • 1
  • 4
  • 9
26
votes
3 answers

XCode 4: Archive is using old project name

I have renamed my project successfully. However, when I create an archive (I'm ready to upload it to the store), Organizer is showing the archive named with the OLD project name. In fact I have renamed this project twice! And it is showing the…
P i
  • 29,020
  • 36
  • 159
  • 267