Questions tagged [file-rename]
rename-file means changing name of a file
1,244
questions
-2
votes
0answers
11 views
How to face a file to a folder with the same name as the other file automatically change its name on Windows 10 [closed]
Essentially, I download a lot of files to a folder and most of them have the name "unknown.png" or "image0.png" ect so I have to manually change them as to not replace the original ...
59
votes
7answers
32k views
Enforce unique upload file names using django?
What's the best way to rename photos with a unique filename on the server as they are uploaded, using django? I want to make sure each name is used only once. Are there any pinax apps that can do this,...
0
votes
0answers
30 views
Removing variable numbers from file names in python
I am new to python programming and I need help with file management. I have files with the file pattern shown below. As you can infer from the regular expression characters in the file pattern, there ...
0
votes
0answers
17 views
Mac - Can you batch rename files if they contain certain criteria?
I have a list of filenames containing country codes, for example:
File1_BG.srt
File2_CS.srt
I'm looking to rename them based on the country code to:
File1_BG.srt becomes Facebook.BG_bg.srt
File1_CS....
0
votes
1answer
39 views
Error 9 when rename worksheet from another workbook
I'm trying to rename a worksheet from another workbook, but I'm getting Error 9
Dim dbWb As Workbook
'the workbook is open I saw it
Set dbWb = Workbooks.Open("Data.xlsx")
Dim ...
0
votes
0answers
19 views
Swiftui: Renaming audio file in documents directory using textfield user input
I am having trouble figuring out how to rename an audio file with multiple views involved. I found most of this code from Voice Recorder App and am trying to add a renaming capability which accepts ...
2
votes
2answers
65 views
Rename-item: Cannot rename because item at … does not exist [duplicate]
I am lost with simple rename-item. Need to change names of folders to "01", "02", "03"... Tried everything but at the end I get this "Item doesn't exist". Sorry ...
0
votes
0answers
26 views
Problems renaming PDFs directly on GitHub
I need to modify the name of a PDF file in a private GitHub repository. I cannot clone the repo because the problems are due to some special characters I would like to eliminate.
Following the ...
0
votes
1answer
55 views
Renaming Files By Adding Numbers Prefixes In File Names
I have a list of files which have number prefixes e.g 1-filename.txt 2-filename.txt ..so on . I found that I skipped a file name as 45-filename.txt . I have files from 1-filename.txt to 100-filename....
0
votes
0answers
38 views
Using Python to rename files in different folders
I have thousands of files to be renamed in several subfolders in the main folder. The existing file name, path, and the new file name are available in an excel file.
I have been using Excel VBA to do ...
1
vote
2answers
37 views
Batch Replace Character in File Names
I have about 600 video files with the $ special character in the title.
I want to batch replace this with a letter s.
I found the powershell code online below and it works fine with replacing letters ...
0
votes
0answers
13 views
Error (WinError 123 ) when using os.rename() to rename Naruto video files
I was writing a python script to rename Naruto videos with messy titles. Here's the code:
import os
import re
def rename_files():
os.chdir(r"C:\Users\Caleb\Videos\Anime\Naruto Shippuden"...
0
votes
0answers
16 views
Linking an image to variables with firebase storage
I would like to add an image to an activity. I want to compare if the variable "name" is already stored in the Firebase-storage as filename: "name.jpg".
A small example: The user ...
0
votes
2answers
3k views
Renaming files from a text list using powershell
I have seen many different postings here on how to approach this task. I have tried them all with minor variations of them to no avail. Every time I run the powershell code, I still get the same error ...
1
vote
1answer
2k views
Batch for removing a text after and before specific characters in files names
I have this kind of files naming system
CR - Plan - Grundriss_RO_STA_MA_C7_TS_0001_01_F - Plan Nord.pdf
and I would like to have a .bat file that removes the parts before and after and changes the ...
-1
votes
1answer
174 views
Cannot file.delete() and file.renameTo() for Java
I am currently making a Jtable that will display and update user data. When updating data, my code will generate a temp.txt file with the new data and then the old Student_Database.txt will be deleted ...
2
votes
5answers
176 views
rename the end of filename by subtracting value
I have on macOS the following files in ns_up/ directory:
sqRatio_ist_LogSplineInterpPk_iz_260.dat
sqRatio_ist_LogSplineInterpPk_iz_261.dat
sqRatio_ist_LogSplineInterpPk_iz_262.dat
...
90
votes
13answers
154k views
Using sed to mass rename files
Objective
Change these filenames:
F00001-0708-RG-biasliuyda
F00001-0708-CS-akgdlaul
F00001-0708-VF-hioulgigl
to these filenames:
F0001-0708-RG-biasliuyda
F0001-0708-CS-akgdlaul
F0001-0708-VF-...
411
votes
13answers
414k views
1
vote
1answer
21 views
Renaming a datafile with a name stored in an object
I have datafile named dat1 I want to rename it to dat2 which I have stored in the object filename.
dat1 <- c(1:5)
filename <- paste("dat2")
If I use,
filename <- dat1
Then the ...
0
votes
0answers
6 views
File renaming renameTo returns true but it deletes the original file
In my android application i am trying to rename files. I have used renameTo method for this purpose. The method returns true which means success but the problem is it is just deleting the content of ...
0
votes
1answer
3k views
How to rename files using R?
I have a bunch of files that have "_001" in their file names. I followed a script posted online and I am at the directory where all my files are located:
filez <- list.files()
sapply(...
2
votes
1answer
68 views
Capitalize First Letter Of Each Word In Multiple Filenames (Powershell)
I have many folders with many files in each that I want to capitalize the first letter of each word for in a batch. I've seen solutions for capitalizing strings, but that's not what I'm after. I use ...
0
votes
1answer
27 views
How to identify modified file names in a directory?
I have the following four files in a directory:
TRAILBLAZER_107-10016_FTP_SCR_CT_CTAC
TRAILBLAZER_107-10016_FTP_SCR_CT_Recon
TRAILBLAZER_107-10016_FTP_SCR_PET_NAC
TRAILBLAZER_107-...
1
vote
3answers
42 views
awk to update filename in directory
In the below I am trying to use awk to change part of a pair of filenames (between the hyphen and underscore) in a directory with a value stored in a variable. The below does execute but the filenames ...
1
vote
0answers
15 views
How to change extension of certain files? [duplicate]
I have some files that look like below
user_conf_loc_week_en.json
user_conf_time_bf_week_en.json
user_conf_map_week_en.json
user_conf_pref_to_week_en.json
// some other files
I have some other files ...
0
votes
0answers
23 views
Pull titles for images from same page
So I'm using C to get images from a site; in more detail I'm downloading the cards of my favourite card game (I'm 12).
system("wget -r -A jpeg,jpg,bmp,gif,png [SITE LINK]");
This is what I'm ...
0
votes
2answers
45 views
Batch Rename Double Letter Folder Problems
Ok so I'm super close to doing what I need to do.
I'm having an issue with my rename command and a double letter at the end of the folder. The folder names in the code have been changed for privacy, ...
1
vote
1answer
31 views
copy and rename files starting at a specific integer value in python
My codes work but for a few pain points that perhaps you can help me understand. I want to copy files from one directory to another and rename them at the same time. for example:
c:\path\
octo.jpeg
...
1
vote
2answers
48 views
CMD to iterate and recursively rename all filenames and append the current subdirectory folder to the current filename
This command in cmd renames all files in the current directory
for /f "tokens=*" %a in ('dir /b') do ren "%a" "00_%a"
But I need to get the current subdirectory name (...
0
votes
0answers
16 views
Mac rename multiple files at once, removing random numbers
Without using the terminal, what would the syntax be to "rename" a group of files on Mac by:
Removing any and all numbers in the file name:
For example, names like: "john smith 1978902&...
0
votes
0answers
14 views
renaming cPanel backup files using Python
I have a CRON job on a couple of different cPanel hosts, which generates a backup a few times a day. Al works well :)
Now I also have a python script on a Raspberry Pi4, which uses FTP_TLS to grab ...
-1
votes
1answer
63 views
AppleScript/Automator: renaming PDF with extracted text content of this PDF
I have a lot of PDFs that I want to rename. The new name should be a text item of this PDF. I wan t to create this as a folder action to drop PDF in and get them renamed. I've com so far with ...
0
votes
0answers
22 views
Why does Python OS.rename cause re-named file to revert to previous file in Sharepoint?
I want to write and save an Excel file in sharepoint. But files are automatically opened as "Read-Only". Users can write into the file but need to click "Editing" to save changes.
...
1
vote
3answers
788 views
How to find and replace part of filenames from list
I have a list of files that I need to rename at the same part of each file, with different values.
Example:
BL_1402B103_abc.wav > BL_C1234-1_abc.wav
BL_15489B59_abc.wav > BL_C1234-5_abc.wav
...
-2
votes
3answers
426 views
Rename first part of filename using batch
I have some problem writing a code for a batchfile that will replace the first part of a file name.
let say we have the files:
abcd123.txt
abcd345.txt
the numeric part(and the ...
0
votes
1answer
96 views
Renaming output file using Spark tool within Google Data Fusion
I have a pipeline in Google Data Fusion which produces a CSV file with the name "part-00000-XXXXXX" (and a file called "_SUCCESS") in a target directory in a Google Cloud bucket. ...
0
votes
1answer
22 views
How to rename the pictures after unzip file with the name based on unzip file's name with python
I have zip files in folder A and I want to unzip it and rename the pictures in the unzip file based on the name of the zip files then move it to folder B. But I don't know how to rename it. Please ...
0
votes
1answer
49 views
File.delete() & File.renameTo() Not Working in Project Environment
I am trying to create an authentication system of sorts that uses a file called Users.dat to store user data. Currently, I am developing a method to remove users by rewriting the Users.dat file, ...
0
votes
1answer
73 views
rename files with pathlib
I'm trying to rename files in a folder using the name of other files that are on a different folder but I'm getting some errors.
The files I'm trying to rename are in the 'OUT' folder. The filenames I'...
-1
votes
1answer
52 views
What am I doing wrong in my windows batch script, I'm trying to understand the logic behind script
So here is a bat script that is working, it is removing letter P from every jpg files that start with letter P in a folder.
@echo off
for %%a in (p*.*) do ren "p*" "/*"
I want ...
1
vote
1answer
27 views
Powershell rename filename by replacing n characters in ascending order
I've got a number of files in the following format
I'd like to replace the 3 characters after 60- in ascending order.
I have used the following code to remove the first 28 characters
get-childitem * |...
-4
votes
2answers
62 views
Batch Command for Renaming files in folders
Just wondering if anyone can help me. Normally I'm pretty got at finding some code I need an to manipulate it but horrible if I have to start from scratch.
I'm a teacher and want to have all the files ...
1
vote
2answers
613 views
PowerShell/Regex: Rename all files, modify number sequence
I currently have a directory with several thousand files in it.
Each file has _c04_ or _c05_ etc. somewhere within the filename.
I need to rename all of these files to _c004_ or _c005_ etc.
The only ...
0
votes
0answers
30 views
recursively copying and renaming file works, then stopped unexpectedly
Context
Needed to copy and rename image file repeatedly until certain counting number reached.
The renaming part have to met certain increasing step.
It's Python 3.7.0
Code
import os
import shutil
...
12
votes
6answers
51k views
How to change file extension at runtime in Java
I am trying to implement program to zip and unzip a file. All I want to do is to zip a file (fileName.fileExtension) with name as fileName.zip and on unzipping change it again to fileName....
0
votes
1answer
28 views
Renaming mp3 files according to its metadata
I am trying to rename all my music file with its title in its metadata.
I am using Pydroid3
import os
from mutagen.easyid3 import EasyID3
def rename_mp3_files(location):
for root, dirs, files in ...
0
votes
1answer
30 views
Replace a value in a file name with an other value from an excel sheet
Hallo I'm an IT student, and this is my first post here on stackoverflow.
The reason I choose to create a post is because I have run into a little problem with a bulk renameing task
I have a two list ...
0
votes
0answers
20 views
Rename multiple files using cmd
I'm trying to rename multiple files in a folder using CMD prompt. Following code renames as file1, file2,... but I want to append from a middle value like file51, file52,...
SET /a "#="
FOR %...
0
votes
0answers
18 views
Python script to rename multiple files in multiple folders
I have a lot of folders with no naming pattern. Each folder contains some files including a problem.md file.
I would like to rename each of problem.md to readme.md.
I found a python script shown ...