Questions tagged [file-rename]
rename-file means changing name of a file
317
questions with no upvoted or accepted answers
6
votes
0answers
150 views
Cannot open file because of its name
I am trying to rename some files and I had a problem with some of them. I'll give an example: I tried to rename a file with the name
"pronunciation_he_ אָדוֹם_אֲדוּמָה". It gave me an error and when I ...
6
votes
0answers
161 views
How not to stage renamed files automatically
When I rename a class, which rename files, in intellij it automatically stage the renamed files in git.
I'd like that intellij stop doing that. Does anyone know if and how to change this automatic ...
4
votes
0answers
2k views
WinError 183 with os.rename()
I'm running a python3.3 script in win7.
At the end of the run I'm deleting a copyFile and renaming the tempFile as copyFile as so:
os.remove(scancpName)
os.rename(scantmpName, scancpName)
Although ...
3
votes
2answers
310 views
How to rename partly the downloaded file using wget?
I'd like to download many files (about 10000) from ftp-server. Names of the files are too long. I'd like to save them only with the date in names. For example: ABCDE201604120000-abcde.nc I prefer ...
3
votes
0answers
265 views
settings.gradle file not found error while renaming zbar-sample
From https://github.com/dm77/barcodescanner I've imported zbar and zbar-sample, when I try to rename zbar-sample it fails by saying settings.gradle not found. But I do have settings.gradle in root. It'...
3
votes
1answer
1k views
Change targetName in VisualStudio 2010 setup project
I am trying to make setup project for my application.
I have added it to my solution with my primary application project. Everything looks fine. I can see detected dependency files:
But i must ...
2
votes
0answers
55 views
Regex renaming group capture
With Regex how to capture the spaces in the {} brackets so I can insert a comma between the words?
I tried the following but it doesn't capture the white-space in the brackets.
(((.*)((\[.*\])\s(\(.*\)...
2
votes
1answer
113 views
In Xamarin.Forms after renaming a Page I get the error “The name 'InitializeComponent' does not exist…”
When I rename a Page (xaml-file) in Xamarin.Forms I often (if not all of the times) get an error involving the InitializeComponent() method.
Why does this occur and what's the best way to fix this?
...
2
votes
0answers
673 views
Node.js - detect rename file/directory event
I need to detect rename event of a particular file/directory. I am using chokidar - this one triggers unlink and add events, thus it is not possible to use it.
I also tried fs.watch - this one ...
2
votes
2answers
999 views
File.renameTo return false
I want to rename my png file. Image current path like this:
/storage/emulated/0/Android/data/sample.png
I want to save this image under app's file directory. I give write external storage permission ...
2
votes
0answers
48 views
renameTo leaves an empty thumbail after renaming images
I am trying to rename an image in my app using renameTo() but after renaming it leaves an empty thumbnail with old file name and size 0 bytes. How can I fix it ?
private void renameFileAlert(){
...
2
votes
3answers
2k views
python download & rename
I have a problem with my code
The purpose of this code is to download a csv file (which called history.csv) and rename this file to the original name which I use selenium to fetch it out of the web ...
2
votes
1answer
280 views
Renaming the log file at the end
In the beginning of the program the log file is named as:
filename='D://my_code_3/logging/'+timestr+'_XFR.log'
###set up logging to file
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(...
2
votes
3answers
177 views
Change/Rename subpages in my URL
I currently have: www.MYPAGE.com/category (a site I reach from my shop site)
But I want: www.MYPAGE.com/shop/category (so the subpages kinda stack)
So how do I actually achieve that ? Working with ....
2
votes
0answers
212 views
How to get real path file name and rename it?
I'm trying to get path file name and post it to sql table, actually my code is really complicated and I couldn't find a solution for this. Here is main part of my code that it's straight to the my ...
2
votes
1answer
209 views
Is there any smart way to rename multiple files on terminal with SVN command?
I have many files to move and rename that's under SVN. The naming rule is below.
current path: /root/parent/child_01.html
new path: /root/parent/child/article_01.html
I know I can rename with "...
2
votes
2answers
3k views
rename files in Python: WindowsError: [Error 2] The system cannot find the file specified
I have looked at the code here and it doesn't look that hard.
Can't resolve WindowsError: [Error 2] The system cannot find the file specified
However, it doesn't work in my case. I quite new to ...
2
votes
2answers
5k views
Ruby On Rails - how to rename currently uploaded file?
This is my method for uploading files:
name = file.original_filename
directory = "images/"
path = File.join(directory, name)
File.open(path, "wb") { |f| f.write(file.read) }
I need to rename the ...
2
votes
1answer
1k views
Batch: how do you bulk rename files (getting close)?
I've seen people do this in Perl, but I'm wondering if there's a way to do it via batch? It's built into Windows, so I think it would be more useful to know how to do this with a batch script. It ...
2
votes
1answer
867 views
Changing the title on an editor when the input changes due to file rename
how would I go about updating the title bar of an Eclipse editor when the file input changes to reflect the new filename? For instance, when the file is renamed but you still have an editor open on ...
2
votes
1answer
725 views
renameTo not working for renaming files
I am trying to rename an image file in my app . But the code is not working .
Basically, I want user to click on Rename button , pop up an alert dialog with an editText, user enters the new name of ...
1
vote
0answers
18 views
How to bind a keyboard shortcut to the “Source Control > Rename…” action?
This question deals with the Git integration that is available in MATLAB (R2020a, Win10).
When editing files that belong to a Git repository through the MATLAB IDE, it is possible to perform various ...
1
vote
2answers
119 views
How can I rename files with Grunt in different folders and sub folders and with a version number dynamically?
I have a the following structure:
src/
..
..
target/
projecta/
css/
vendor/
bootstrap.css
..
...
1
vote
1answer
38 views
Rename multiple file with special characters in Fedora
I have several hundred files in the below format:
'[animalpics.com][977]bluejays.png'
'[animalpics.com][9]lions.jpg'
'[animalpics.com][99]colts.jpg'
I would like to rename all the files to just the ...
1
vote
0answers
19 views
Batch script variable issues - “VAR_%a”
The issue i'm having is at the very end on this specific line:
for %a in (*) do ren "%a" "%Text%_%a"
More specifically, this part:
"%Text%_%a"
I'm able to substitute the variable out for the ...
1
vote
2answers
212 views
Rename multiple file of different extension with the same name in the incremental order
I have multiple folders in which I have files named as follows:
1500001.jpg
1500001.xml
1600002.jpg
1600002.xml
9876543.jpg
9876543.xml
As you can see I have one jpg file and its ...
1
vote
1answer
404 views
Rename files using rename command in bash shell
I have read other similar questions on the forum and I can't understand why the command I tried doesn't work.
I have a list of files named in the form aaaa_100_aaaa.csv, aaaa_100_aaab.csv, ...
1
vote
3answers
663 views
How to detect if a file has been renamed?
I am currently implementing my own version of WatchService API in Java.
(You can refer to this example to understand what file WatchService does.)
I have implemented code for the following cases :...
1
vote
0answers
730 views
FileNotFoundError: [WinError 3] - os.rename not working
Feels like I have tried almost everything - and can't for the life of me work out what's going wrong in this code. I've run it on a much simpler example (just os.rename, no manipulations, file_name ...
1
vote
0answers
50 views
File not found issue on Oreo
I am using Huawei Honor 9 Lite handset (Model LLD-AL10) with Android 8.0.0 (EMUI version 8.0.0). At the end of month July 2018 (around 30th or 31st), I had done the below things on my handset:
...
1
vote
0answers
57 views
Rename certain portion of filepaths in current directory recursively
Let's assume I have following directory tree:
.
|-- foo
`-- foodir
|-- bardir
| |-- bar
| `-- foo
|-- foo -> bardir/foo
`-- foodir
|-- bar
`-- foo
3 ...
1
vote
1answer
51 views
Renaming files according to fasta header
I have downloaded 240 genomes from NCBI and when downloaded they get a filename according to their assembly numbers. I would like to rename the files according to their species name, instead of their ...
1
vote
0answers
55 views
Rename files and save a log of old and new filenames using R
I am trying to remove bias from a microscopy analysis, so I want to make it so the experimenter doesn't know what the conditions are for the image they are looking at.
To do this I need to rename ...
1
vote
1answer
32 views
Changing multiple filenames that with a number already in the file name in Unix
so I want to batch change name files with these type of names (about 400 files):
L1_Mviridis.fasta
L2_Mviridis.fasta
L3_Mviridis.fasta...
to this:
L1_1_Mviridis.fasta
L2_2_Mviridis.fasta
...
1
vote
1answer
205 views
renameTo() not working for renaming images and returns false
I have an image gallery app, I am trying to rename images using renameTo() method but it is not able to change the name of files and returns false. I read many questions on SO for renaming files and ...
1
vote
0answers
155 views
Filewatcher FIRST Renamed event after 15 seconds of inactivity will not be captured
I'm pretty sure that I have exhausted all my options before posting here and I have spent hours trying to search for an answer (and of course testing out my code).
I am using Ubuntu 16.04.3 LTS. Code ...
1
vote
3answers
92 views
Linux rename files before directories
I have the following command that I run to lowercase files/directories, replace . with _ and various other manipulations. The problem with it is that it seems to try to rename the directories first ...
1
vote
1answer
36 views
New file not getting called on renameTo()
I used the following code to edit the file OIMV2Migration.sh on linux.
String oldFileName = "OIMV2Migration.sh";//file to be edited
String tmpFileName = "tmp_try.dat"; //new file containing ...
1
vote
0answers
118 views
File extension not changing - Android
I'm trying to create an app in Android, and part of it's functionality is renaming .jpg file extensions to .jpeg file extensions. However, it's not working.
filepath is the path of the .jpg file, and ...
1
vote
1answer
231 views
How to rename a link file on Windows with python?
I have some link files on windows, then I put them in a folder, I want to rename them as 0 1 2 ... , so windows can sort them automatically.
I tried os.rename('src.txt.link', '0'), but the result is ...
1
vote
0answers
213 views
Renaming files at command line to a different length filename
I need to rename multiple files in a directory. They can be copied to another directory if necessary.
The filenames will be in the format 57.jpg, 57-1.jpg, 57-2.jpg etc. The suffix may be double ...
1
vote
1answer
931 views
Replace Underscores with Spaces in Filename of Single File via Batch
I've found the following post:
Batch File to replace underscores with spaces in a filename
This seems to work but when you drag a file onto the batch file, it processes all of the files in the folder....
1
vote
1answer
821 views
How to rename library .a product file name in Xcode 8?
I downloaded the following repository from GitHub:
https://github.com/zwaap/hello-int-pinvoke/tree/master/src/HelloInt.Native
I tried renaming my project to something with "lib" in the name by ...
1
vote
0answers
535 views
Copy file from the user selected path and place it in project folder as backup
I have a user form to browse an excel file & a text file into 2 different textboxs (Selectionfile say ABC.xlsx & relationshipfile say GHJ.txt resp.) from local folders. On clicking the proceed ...
1
vote
0answers
43 views
“Argument not valid” after running it correctly. Ideas on how to MAKE A COPY of a SPECIFIC SPREADSHEET (not a sheet, but the entire file)?
I am having trouble creating a spreadsheet using names defined in cells within a specific file (also a spreadsheet)...
Full code below:
function defineNames() {
var ss = SpreadsheetApp.openById("...
1
vote
0answers
9 views
How to keep the reference to a file/dir after renaming?
XCode 7.3 can detect if a project directory has been moved/renamed: not only it keeps the project in the "recent projects" dialog which appears at startup, but it also shows the new filename correctly ...
1
vote
0answers
55 views
Bulk renaming files based on a mapping
I have a txt file with a mapping of filenames and what I need them to be converted to. Each old_filename and new_filename is different. For example the mapping looks like the following:
{Matt's ...
1
vote
0answers
208 views
Cannot move into data/data/package (RenameTo fails with ErrnoException EXDEV, Cross-device link)
Is there any chance to move a file inside the device's internal storage
from /storage/emulated/0/DCIM/video.mp4
to /data/data//files/video.mp4
without getting ErrnoException: rename failed: EXDEV (...
1
vote
0answers
34 views
Rename files uniquely during uploading
I want to upload images and have them renamed after the user's full name. That worked well but i want them named uniquely by adding a number so for example. Fname_Lname_1.jpg , Fname_Lname_2.jpg ,etc. ...
1
vote
1answer
716 views
Write a csv file and send it with other name as attachment in android
Following code is working to save the Data.csv file and send it by mail.
I want to save the file as it is with the current name Data.csv and then send this file with other name. For Example, newname....