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
1
vote
0 answers

Powershell - Move Files older x Days and Rename if file already exists

I try to make Script who can move Files older 31 Days and if a file already exists in Destination, the moving File shall be renamed. I didnt get that happen. The Code so far is : Start-Transcript -Path "D:\LOG\LOG_OLDFILES.txt" -append get-childitem…
rzhell
  • 35
  • 5
1
vote
1 answer

How can I rename a column based on a cell value in Pyspark?

Currently I have this Situation: signal_name timestamp signal_value 0 alert 1632733513 on 1 alert 1632733515 off 2 alert 1632733518 on I want to rename the column signal_value with the signal_name. The df was…
Horseman
  • 297
  • 1
  • 14
1
vote
1 answer

Python Pandas - rename a value conditionally

df2 = np.where(df2['color'] != 'blue' | 'red') I want to create one category for many categorical values, such as: If the color is not blue or red, call the color "other" Please and thank you <3
bowen_eldr
  • 13
  • 2
1
vote
0 answers

Finding and copying files in subfolders to a unique folder giving them their path names

I need to do a bash script in order to copy all files which are in various subfolders and sub-subfolders of a main directory to a unique another folder while giving them a new name indicating their source. Source paths and files are…
OlM
  • 47
  • 5
1
vote
1 answer

Cassandra Old data deletion

On cassandra, we only need 100 days of data for specific tables. However, we only recently set the TTL value and the data older than that still stays in the system as stale data. We were thinking of different approaches to delete the old data out of…
Radhika
  • 423
  • 7
  • 22
1
vote
0 answers

How to batch rename sub-folders with 'Parentfolder + ...' name

I am new to python but am keen to learn/optimise some basic functions which later will come in very handy for larger dataset handling. I have a series of folders where there is a list of parent folders all with the same stem but different number,…
Kalsi
  • 11
  • 1
1
vote
0 answers

Will Python 'rename' still attempt to rename a file if both inputs are the same?

In general, os.rename requires two inputs, the 'original' and the 'new' filename. Parameters: source: A path-like object representing the file system path. This is the source file path which is to renamed. destination: A path-like object…
Patrick
  • 13
  • 2
1
vote
2 answers

Renaming many folders in PowerShell

I have over 1000+ files that have to be renamed. The first set folder and/or files are grouped by location, so the first four characters are the same for each file; there are four-five different locations. I need to delete the first few characters…
Kambridge
  • 11
  • 1
  • 2
1
vote
3 answers

Rename a variable each time the code is run (python)?

I have a bit of python code that's set to run on a schedule. (I think my problem is the same as if it were within a loop.) Let's say that in its most basic form, the code snippet looks something like this: A = 1 B = 2 renameMe = A + B Let's say…
1
vote
1 answer

How to change string values in column, saving part of it?

I have a dataframe: id value 4_french:k_15 10 87_nov:k_82 82 11_nov:k_10 10 1_italian:k_11 9 I want to rename values in column id which have nov:k_ giving them new id k_10 or k_82 so desired…
french_fries
  • 1,149
  • 6
  • 22
1
vote
1 answer

Bash dirs, files & files content renaming

I am trying to change a very simple word ("discussion") by another ("item") in a PHP script with files and a lot of subfolders. I would like to change this word: 1- in all the files content 2- in the files names 3- in the directories names A simple…
user347284
1
vote
4 answers

Bash script; Renaming files in /subdirectories

I have huge file archives that I host on my old-skool BBS. The [Mystic] software isn't as forgiving or capable as Linux with long-filenames OR extended characters. Filenames should be less than 80 characters long. Filenames should only have chars…
Paulie420
  • 21
  • 1
1
vote
5 answers

How can I gain permission to rename a file for my Ruby program?

As per the answer to this question, I am trying to backup a file by renaming it, before I replace it with a new, modified file with the old name. As per the comments and the documentation here, I am using the following line of code: …
Raven Dreamer
  • 6,940
  • 13
  • 64
  • 101
1
vote
5 answers

Eclipse asking for module named after the old project name

I'm trying to make my project modular on Eclipse, but I'm running into an issue. I have added the module-info.java file through right-clicking on the project > Configure > Create module-info.java. However, when I run, I get the error Error occurred…
Jak
  • 178
  • 10
1
vote
1 answer

Change column names of data frames stored in a list by condition

I have a list with several data frames of different taxa. The df's for the different taxa are of different length and have different names for columns with the "same information", e.g. "abundance", "abund", "individuals". I show you an…
1 2 3
99
100