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
1 answer

NameError: name 'my_gfile' is not defined - glob python

Trying to create script that can create naming convention for the files on specific folder using glob, but when I run the script I encounter this error, May I know what I need to change on my script? from datetime import datetime import os import…
Rex Skys
  • 29
  • 3
1
vote
1 answer

rename batch of files

is there a way rename multiple items in a way that words switch place or move word to the end of the phrase/item name ? ABCD 12550.txt into 12550 ABCD.txt im assuming this will start with Rename-Item, but what then? There is a space between…
autopilot1
  • 13
  • 3
1
vote
2 answers

How to identify and rename duplicate values using numbers in PHP array?

I have a PHP array as below : Array ( [0] => QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client) [1] => Microsoft Network Adapter Multiplexor Driver [2] => QLogic BCM57810 10 Gigabit Ethernet (NDIS VBD Client) #75 [3] => …
James.R
  • 23
  • 8
1
vote
0 answers

How can I create a Regex that matches and transforms a period delimited path?

I am using den4b Renamer to rename a lot of files that follow a specific pattern. The program allows me to use RegEx: (https://www.den4b.com/wiki/ReNamer:Regular_Expressions) I am stuck trying to conjure up an expression for a specific pattern. My…
fmotion1
  • 237
  • 4
  • 12
1
vote
1 answer

where or how does local git repository store the github repository link or id?

I have a local windows git project that I'm synching regularly with github. I am working with visual studio code. I renamed the github repository from FT-db-webapp-service to FT-DB-Tools, without doing anything locally. the repo url has changed…
OJNSim
  • 736
  • 1
  • 6
  • 22
1
vote
1 answer

Passing a column name for a new column in a function without tidyeval?

I have worked a solution to this problem with tidyeval, is there a base R method? library(dplyr) new_col <- function(df, col_name, col_vals){ df |> cbind(temp_name = col_vals) |> rename({{col_name}} := temp_name) } sleep %>% …
tiptoebull
  • 161
  • 1
  • 8
1
vote
1 answer

Can OpenMP worker-threads be named?

Using top, I can see my application working -- and consuming multiple CPUs, as expected. However, I'd like to be able to drill down into the CPU-consumption by the different workers, and yet, these are indiscernible in top's output, which shows the…
Mikhail T.
  • 3,043
  • 3
  • 29
  • 46
1
vote
2 answers

Renaming multiple columns in Julia DataFrames

I have the following Julia Daataframe; data_test = DataFrame(Time = 1:2, X1 = [0,1], X2 = [10,5]) And I have a list of names as follows; technology = ["oil", "gas"] How do I rename columns X1 and X2 using the list (excluding Time column). I can do…
M.B
  • 19
  • 7
1
vote
1 answer

Unifying variable level names based on manual entry text variations in R

The data I am using are based on self completed, mannually entered text responses to a questionnaire. The problem is, especially with regards to fish species, people abbreviate, call them by different names, spell things wrong, etc. How do I take…
Chris Bova
  • 134
  • 1
  • 2
  • 9
1
vote
2 answers

Bash move files and rename it as username_filename in a different folder

There are 4 user folders user1, user2, user3 and user4. They all have music in their folder and I need to move these .mp4, .mkv and .mp3 files into the folder /tmp/Papierkorb Also I need to rename it like, when user1 has a music file, it should…
Martin2K02
  • 11
  • 3
1
vote
2 answers

How to rename multiple Columns in R?

My goal is to get a concise way to rename multiple columns in a data frame. Let's consider a small data frame df as below: df <- data.frame(a=1, b=2, c=3) df Let's say we want to change the names from a, b, and c to Y, W, and Z…
Jaweed
  • 11
  • 2
1
vote
4 answers

Transform pandas dataframe rename columns based on row values

I have the following data frame df_in data = [{'s':123, 'x': 5, 'a': 1, 'b': 2, 'c': 3}, {'s':123, 'x': 22, 'a': 4, 'b': 5, 'c': 6}, {'s':123, 'x': 33, 'a': 7, 'b': 8, 'c': 9}, {'s':124, 'x': 5, 'a': 11, 'b': 12, 'c': 3}, …
1
vote
1 answer

How to rename files based on CSV file with FOR /F loop?

I'm trying to automate renaming of files based on a CSV such as the one shown below: Name,FullName John,JohnDoe Jane,JaneDoe Joe,JoeDoe Let's say I have 3 text files within the same folder of my .bat called John.txt, Jane.txt, Joe.txt and I want to…
Jen
  • 13
  • 2
1
vote
2 answers

batch rename matching files using 1st field to replace and 2nd as search criteria

I have a very large selection of files eg. foo_de.vtt, foo_en.vtt, foo_es.vtt, foo_fr.vtt, foo_pt.vtt, baa_de.vtt, baa_en.vtt, baa_es.vtt, baa_fr.vtt, baa_pt.vtt... etc. I have created a tab separated file, filenames.txt containing the current…
1
vote
1 answer

No code I run to rename this column will work

I am trying to rename the last column in this df: Entity Year Sales of cigarettes per adult per day (International Smoking Statistics(2017)) 0 Armenia 1988 12.0 1 Armenia 1989 11.6 2 Armenia 1990 11.9 3 Armenia 1991 9.3 4…
Ven
  • 37
  • 1
  • 9