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
47
votes
6 answers

Handling renames: svn vs. git vs. mercurial

How do each of these VCS handle renames? I have found a lot of contradicting information stating that git tracks LOC (lines of code) instead of files, renames would therefore have no meaning for it.
Johannes Rudolph
  • 35,298
  • 14
  • 114
  • 172
47
votes
7 answers

rename the columns name after cbind the data

merger <- cbind(as.character(Date),weather1$High,weather1$Low,weather1$Avg..High,weather1$Avg.Low,sale$Scanned.Movement[a]) After cbind the data, the new DF has column names automatically V1, V2...... I want rename the column by…
janicebaratheon
  • 976
  • 1
  • 10
  • 21
46
votes
9 answers

Error message when running simple 'rename' function in R

Below a very simple data frame example I found in the internet. Running this in RStudio on my machine turns out an error message: Error: All arguments to rename must be named. The rename function seems to be straight forward but doesn't work for…
Mike
  • 477
  • 1
  • 4
  • 4
45
votes
9 answers

git rename many files and folders

I am trying to rename many files in my application and need to be able to do a rename in all subdirectories from the app root through git (i.e. git mv %filenamematch% %replacement%) that only replaces the matching text. I'm no good with bash…
Jonathan
  • 10,936
  • 8
  • 64
  • 79
45
votes
6 answers

Renaming a File() object in JavaScript

I'd like for my users to be able to re-name a file before uploading it. I have a File object in Javascript which has a name property that is already set, but i'd like for this to be able to be updated. Right now doing the obvious myFile.name =…
Chris Barr
  • 29,851
  • 23
  • 95
  • 135
43
votes
5 answers

Rename multiple dataframe columns, referenced by current names

I want to rename some random columns of a large data frame and I want to use the current column names, not the indexes. Column indexes might change if I add or remove columns to the data, so I figure using the existing column names is a more stable…
Robert Kubrick
  • 8,413
  • 13
  • 59
  • 91
41
votes
5 answers

Refactor rename broken in Intellij IDEA

Somehow, I managed to break my refactoring capabilities in Intellij IDEA 12. I have somehow disabled it for my project. Renaming a member through Shift+F6 doesn't work. The inline edit box is not drawn, nothing happens. I know of the refactoring…
Rens Verhage
  • 5,688
  • 4
  • 33
  • 51
40
votes
4 answers

Git: rename directory (case-only) on Windows

I want to rename a directory versioned by Git on a Windows system (change the case of the directory name): $ git mv docs DOCS Rename from 'docs' to 'DOCS/docs' failed. Should I try again? (y/n) n fatal: renaming 'docs' failed: Permission…
Thomas S.
  • 5,804
  • 5
  • 37
  • 72
40
votes
5 answers

using header() to rewrite filename in URL for dynamic pdf

I have a php script that generates a pdf report. When we go to save the pdf document, the filename that Acrobat suggests is report_pdf, since the php script is named report_pdf.php. I would like to dynamically name the pdf file, so I don't have to…
user151841
  • 17,377
  • 29
  • 109
  • 171
40
votes
1 answer

Linux zip command: add a file with different name

I´d like to add a file in a zip file, with a different name, and avoiding the creation of a new file with the desired name. For example, I´d like to add the file myfile.txt to a zip, but renaming it to myfile2.txt.
Luis Andrés García
  • 5,852
  • 10
  • 43
  • 57
38
votes
5 answers

Visual Studio Code (Mac OS) rename symbol doesn't work

When I right click and try to rename a variable name in Microsoft Visual Studio Code on Mac OS Mojave, it prompts for the new name, I hit enter and nothing happens. I have Python extension and Latex extension installed. Usually there are no errors,…
Adam B
  • 3,662
  • 2
  • 24
  • 33
38
votes
10 answers

Batch rename sequential files by padding with zeroes

I have a bunch of files named like so: output_1.png output_2.png ... output_10.png ... output_120.png What is the easiest way of renaming those to match a convention, e.g. with maximum four decimals, so that the files are…
slhck
  • 36,575
  • 28
  • 148
  • 201
37
votes
2 answers

Renaming multiple columns with dplyr rename(across(

Hey i'm trying to rename some columsn by adding "Last_" with the new version of dplyr but I keep getting this error Error: `across()` must only be used inside dplyr verbs. this is my code data %>% rename(across(everything(), ~paste0("Last_",…
Ian.T
  • 1,016
  • 1
  • 9
  • 19
37
votes
3 answers

How to rename a column name in maria DB

I am new to SQL, I was trying to change column name in my database's table. I am using 'xampp' with 'maria DB' (OS - Ubuntu 18.04) I tried all of the followings: ALTER TABLE subject RENAME COLUMN course_number TO course_id; ALTER TABLE subject…
Kaveen Hyacinth
  • 495
  • 1
  • 4
  • 10
37
votes
3 answers

Recursively renaming files with Powershell

I currently have a line to batch rename files in a folder that I am currently in. dir | foreach { move-item -literal $_ $_.name.replace(".mkv.mp4",".mp4") } This code works perfectly for whatever directory I'm currently in, but what I want is to…
Matthew
  • 1,179
  • 2
  • 12
  • 16