Questions tagged [file-rename]

rename-file means changing name of a file

renaming a file means changing name of a file. Almost all operating systems allow to change the name of a file after it has been created with some other name. Usually a platform provides a GUI and a CLI interface to allow users to rename a file, as well as API interfaces to rename a file programmatically.

1496 questions
-1
votes
1 answer

How can I create a list or a vector with the original file name beside the corresponding number?

I converted the names of 12000 different .TXT files into a sequence of numbers from 1 to 12000. Using Matlab, how can I create a list or a vector with the original file name beside the corresponding number?
-1
votes
1 answer

Yii can't rename/move an uploaded file

My controller Sitecontroller.php, view file upload_new.php, model is Resume_edit.php. I got this error : Fatal error: Call to a member function saveAs() on a non-object in C:\wamp\www\yii\jobsite_orginal\protected\controllers\SiteController.php on…
user3475251
  • 19
  • 1
  • 7
-1
votes
1 answer

Python FileExistsError

Here is my code for replacing all the occurrences of kyle and john with mike and jim respectively. import os import fileinput import sys rootdir ='C:/Users/sid/Desktop/app' searchTerms={"kyle":"mike","john":"jim"} def…
Wolf
  • 3,019
  • 3
  • 17
  • 14
-1
votes
2 answers

Dos Command rename folders and subfolders with special characters

How can I remove the special character using DOS Command on folder and subfolders?…
-1
votes
1 answer

Rename a image file in play framework

I am trying to rename a image file play framework's public/images folder. I tried to use play.getFile() and viirtualFile class, irrespective of what i use i end up with the exception below. Please let me know if i am missing something. VirtualFile…
-1
votes
1 answer

Trying to change name of uploaded file on upload in PHP but its not working?

im using php to upload images to my site, i want to rename them as soon as they are uploaded and before they are placed in the server directory so that i can eliminate the chance of images being overwritten because of the name of the file, below is…
Ryan Kelly
  • 163
  • 1
  • 2
  • 9
-1
votes
1 answer

Batch code to re-name set of template files by changing part of the name of one file (all files to copy changes to the same text)

I have created a filing system containing folders as templates for re-creating a set of information to be used when we accept bookings and need a batch command to rename all files within a directory but in a very specific way. So to be more precise…
Danny
-2
votes
1 answer

How to use `rename` rename a list of files in Linux

I want to use rename to process a bundle of files like this: GSM5901579_203007520013_R01C01_Grn.idat.gz -> 203007520013_R01C01_Grn.idat.gz GSM5901579_203007520013_R01C01_Red.idat.gz ->…
-2
votes
1 answer

how to close this file to rename and delete a file("Stream closed")

Hi I am having trouble deleting and renaming my file this is because my file is still open but when I try to close my file I then get a stream closed which means my file is closed, my question how do I get my code to delete and rename my file even…
chris
  • 13
  • 3
-2
votes
1 answer

How to add month and year in pdf batch file using powerscript?

I have 500 files that needed to be renamed from: surname_dtr.pdf to surname_YYYYMMdtr.pdf where YYYY is the current year, and MM is the previous month. I have known that this is possible using script. I do not have a background in writing a script…
Coco
  • 21
  • 8
-2
votes
2 answers

How To Rename Files (Using Python OS Module)?

I have a folder which contains +100 songs named this way "Song Name, Singer Name" (e.g. Smooth Criminal, Michael Jackson). I'm trying to rename all the songs to "Song Name (Singer Name)" (e.g. Smooth Criminal (Michael Jackson)). I tried this code.…
K. M.
  • 107
  • 7
-2
votes
1 answer

My mv command is showing no such file or directory when renaming a file

In the below code I am renaming a file with a date field addition to it.but the error says no such file or directory.its doing the moving operation instead of renaming it. Thanks. #!bin/bash cd /some/directory/name LIST=$(ls) for FILE in…
Overlord
  • 1
  • 2
-2
votes
2 answers

Shell: Rename a file

In my directory I have thousands of PDF files. I want to write a shell script where goes through all the files and trims the last 16 characters and and saves back to the directory without keeping the old…
KaanEm
  • 31
  • 1
  • 2
-2
votes
1 answer

I cannot rename a file when it is being downloaded

Below is my code to download a YouTube video and then converting it into an audio file. But while renaming it, I am getting an error. Please explain my problem and please provide me a solution. import os import tkinter as tk from tkinter import…
Eriq Codes
  • 18
  • 7
-2
votes
1 answer

os.rename does not succeed in renaming in subdirectories, throws FileNotFoundError despite using glob.glob with recursive=True

The following code is meant to rename files named "notes" to "notes.html.pmd" in the cwd and in sub-directories. Those still on Python3.7 and earlier versions need to get rid off the walrus operator and substitute fileListOld = glob.glob(f"{(cwd :=…
John Smith
  • 835
  • 1
  • 7
  • 19