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
-4
votes
2 answers

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 labelled consistently as I have to send them…
Mark
  • 1
  • 1
-4
votes
1 answer

Rename excel file depending on Access Table first field

By using VBA Access ,I want to copy excel and rename it depending on Table first field. In below example, For example, instead of using fixed name like: FileCopy "C:Documents\Folder\CurrentFile.xlsx", "C:\Documents\New Folder\NewFile.xlsx" I want…
-4
votes
2 answers

How to rename list of files to new arbitrary list

I have a list of files: Wav16.ogg, Wav17.ogg ... Wav76.ogg that I want to convert to: a65.ogg, b72.ogg ... b32.ogg This is what I have so far: import os import numpy as np OldContent = [i.strip().split() for i in…
Daniel George
  • 23
  • 1
  • 9
-4
votes
3 answers

Change file extension?

What the best way is change file extension of Java?
Chen Xinhua
  • 1
  • 1
  • 6
-5
votes
1 answer

Python - Swap two file directories with each other

I have a robot and it is set up in a way to take commands from the front end of the website to then run a command on the robot. For example if command == 'CF': os.system('aplay /home/pi/sound/wavycf.wav') I need somthing that will swap two…
user3354787
  • 13
  • 1
  • 1
  • 7
-5
votes
3 answers

Rename file name

Here is my code : import os def rename_file (): file_list = os.listdir (r"C:\Users\Sushant\Desktop\test") print (file_list) for file_name in file_list: os.rename(file_name, file_name.translate(None , "0123456789" )) rename_file…
JOh
  • 11
  • 1
-5
votes
2 answers

Renaming image to username while uploading it into mysql database

Renaming image to user name while uploading in mysql $file=$_FILES['image']['tmp_name']; $image= addslashes(file_get_contents($_FILES['image']['tmp_name'])); $image_name= addslashes($_FILES['image']['name']); …
-6
votes
1 answer

How to rename many files in many folders with python?

i'm trying to erase all indexes (characters) except the last 4 ones and the files' extension in python. for example: a2b-0001.tif to 0001.tif a3tcd-0002.tif to 0002.tif as54d-0003.tif to 0003.tif Lets say that folders "a", "b" and "c" which…
-6
votes
1 answer

Java File.renamTo not working

I have made the code which renames all the jpg files in a directory from 1 to n (number of files).. if there were let say 50 jpg files that after running the program all the files are renamed to 1.jpg ,2.jpg and so on till 50.jpg But i am facing…
Hamza Sheikh
  • 117
  • 3
  • 13
-7
votes
3 answers

Getting error in this python code while printing renamed files

It is a code to rename all the files in a given directory but it seems while running in my terminal it giving me a syntax error at the print statement. Also if I comment the statement I get an error at the if statement of main. If I remove that too…
bluearpit
  • 3
  • 2
1 2 3
99
100