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
91
votes
10 answers

Rename files using regular expression in linux

I have a set of files named like: Friends - 6x03 - Tow Ross' Denial.srt Friends - 6x20 - Tow Mac and C.H.E.E.S.E..srt Friends - 6x05 - Tow Joey's Porshe.srt and I want to rename them like the following S06E03.srt S06E20.srt S06E05.srt what should…
orezvani
  • 3,595
  • 8
  • 43
  • 57
90
votes
2 answers

Is it possible to rename an Azure App Service plan using the Azure Portal?

Is it possible to rename an App Service Plan? I have already tried in both the old and new portals and can't find any rename options.
Mark Cooper
  • 6,738
  • 5
  • 54
  • 92
85
votes
7 answers

eclipse workspace: how to rename workspace

There is no option in the file menu to rename a workspace. Is the recommended practice to close eclipse, rename the folder, and re-open? I worry about some potential dangling references in configuration files corrupting my…
Alexx
  • 3,572
  • 6
  • 32
  • 39
82
votes
2 answers

Renaming Column Names in Pandas Groupby function

Q1) I want to do a groupby, SQL-style aggregation and rename the output column: Example dataset: >>> df ID Region count 0 100 Asia 2 1 101 Europe 3 2 102 US 1 3 103 Africa 5 4 100 Russia …
Baktaawar
  • 7,086
  • 24
  • 81
  • 149
81
votes
3 answers

Renaming a directory in C#

I couldn't find a DirectoryInfo.Rename(To) or FileInfo.Rename(To) method anywhere. So, I wrote my own and I'm posting it here for anybody to use if they need it, because let's face it : the MoveTo methods are overkill and will always require extra…
Alex Marshall
  • 10,162
  • 15
  • 72
  • 117
79
votes
12 answers

Rename more than one column using withColumnRenamed

I want to change names of two columns using spark withColumnRenamed function. Of course, I can write: data = sqlContext.createDataFrame([(1,2), (3,4)], ['x1', 'x2']) data = (data .withColumnRenamed('x1','x3') .withColumnRenamed('x2',…
user2280549
  • 1,204
  • 2
  • 12
  • 19
75
votes
7 answers

Append date to filename in linux

I want add the date next to a filename ("somefile.txt"). For example: somefile_25-11-2009.txt or somefile_25Nov2009.txt or anything to that effect Maybe a script will do or some command in the terminal window. I'm using Linux(Ubuntu). The script or…
sami
  • 867
  • 1
  • 8
  • 13
73
votes
7 answers

Rename SQL Azure database?

How can i rename the database in sql Azure? I have tried Alter database old_name {MODIFY NAME = new_name} but not worked. Is this feature available in SQL Azure or not?
Arun Rana
  • 8,426
  • 14
  • 67
  • 107
72
votes
6 answers

How can I rename a collection in MongoDB?

Is there a dead easy way to rename a collection in mongo? Something like: db.originalCollectionName.rename('newCollectionName'); And if not, what is the best way to go about effectively renaming one?
Aaron Silverman
  • 22,070
  • 21
  • 83
  • 103
71
votes
4 answers

Name columns within aggregate in R

I know I can *re*name columns after I aggregate the data: blubb <- aggregate(dat$two ~ dat$one, ...) colnames(blubb) <- c("One", "Two") Nothing wrong with that. But is there a way to aggregate and name the columns in one go? Sort of like: blubb <-…
user1322720
68
votes
3 answers

How to move files using FTP commands

Path of source file is : /public_html/upload/64/SomeMusic.mp3 And I want to move it to this path : /public_html/archive/2011/05/64/SomeMusic.mp3 How can i do this using FTP commands?
Kermia
  • 4,171
  • 13
  • 64
  • 105
68
votes
4 answers

A sane way to rename a directory in subversion working copy

While somehow versed in VCS (regular svn, git and git-svn user) I can't seem to wrap my head around this peculiar SVN behavior. Whenever I need to rename a directory in my SVN working copy from an otherwise 'clean' state - i.e svn status returns…
Lloeki
  • 6,573
  • 2
  • 33
  • 32
67
votes
3 answers

concat series onto dataframe with column name

I want to add a Series (s) to a Pandas DataFrame (df) as a new column. The series has more values than there are rows in the dataframe, so I am using the concat method along axis 1. df = pd.concat((df, s), axis=1) This works, but the new column of…
vaer-k
  • 10,923
  • 11
  • 42
  • 59
66
votes
10 answers

How to zero pad numbers in file names in Bash?

What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero-padded file names: (foo00001, foo00002, ..., foo01300, ..., fooN)
Trastle
  • 5,155
  • 6
  • 26
  • 20
64
votes
6 answers

Rename result columns from Pandas aggregation ("FutureWarning: using a dict with renaming is deprecated")

I'm trying to do some aggregations on a pandas data frame. Here is a sample code: import pandas as pd df = pd.DataFrame({"User": ["user1", "user2", "user2", "user3", "user2", "user1"], "Amount": [10.0, 5.0, 8.0, 10.5, 7.5,…
Victor Mayrink
  • 1,064
  • 1
  • 13
  • 24