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

Removing specific part of filename in Linux (what's after the second dash) for all files in folder

I use the command line utility youtube-dl to download videos from youtube and make mp3s from them with avconv. I'm doing this under Ubuntu 14.04 and very happy with it. The utility downloads the files and saves them with the following name…
Bodo
  • 115
  • 6
-2
votes
3 answers

How to rename multiple files at once by removing a varying part in the file name on Windows?

I have a windows folder having 500+ files with file names ending with the string " 203" Example: 1X 203.bmp 2X 203.bmp 1086 203.bmp 25G 203.bmp ... How can i bulk rename all files in this folder, removing the " 203" string from the file names?…
MK07
  • 1
  • 1
  • 1
  • 4
-2
votes
2 answers

Rename .txt files to values separated by comma at first line in file?

Following this thread: Rename .txt files to first line in file? I came up with this code: import os for filename in os.listdir("."): if filename.endswith(".txt"): base, ext = os.path.splitext(filename) with open(filename, 'r') as…
Andrés Chandía
  • 999
  • 1
  • 16
  • 32
-2
votes
2 answers

modify several file names using shell

I would like to change several files name in my current directory, like this for example : test1 test2 test3 And I would like to rename every file with a command (mv I think) to have that (for example) : foo1 for2 foo3 Can you help me ?…
Tjamat
  • 193
  • 1
  • 11
-3
votes
1 answer

If file exist on destination append number to file

i know this question is asked before but i cant figure out how to get this to work. I have a function that triggers whenever i delete a post. It will then move the file to a existing folder on the server. what i would like for it to do is to check…
-3
votes
1 answer

How to use powershell to rename batch files?

I have a lot of files in a folder: aa001.txt aa002.txt ... I want to rename them to: bb001.txt bb002.txt ... Can I use PowerShell to do such renaming? Thanks!
Wei Ye
  • 131
  • 4
-3
votes
1 answer

How to remove spaces in filenames on s3 bucket programmatically using boto with python?

so I have 1000s of files on my s3 bucket. But, the names of the files contain spaces. I want to replace the space with '_' programmatically using boto python. How do I achieve this? Thanks. Snapshot of filenames:
-3
votes
1 answer

Rename substring of filename based on partial filename match in same folder

I have a folder full of files (.avi and .txt files): MyVideo1-MyEncode.avi MyVideo1.avi 16-05-2019 15-41-01.txt My Video 2.avi My Video 2.avi 16-05-2019 16-43-11.txt My Video 3 [Summer]-MyEncode.avi My Video 3 [Summer].avi 16-05-2019…
-3
votes
3 answers

How to upload image a random name?

How do i give the image a random name instead of taking the name the image currently have when being uploaded? if(isset($_FILES['image'])){ $errors= array(); $file_name = $_FILES['image']['name']; $file_tmp =$_FILES['image']['tmp_name']; …
Evrim
  • 1
-3
votes
1 answer

DOS command to remove a space from a file name

I have 1 file in folder \\myserver\myfolder whose file name has a space like First Name_20180810.csv. I need a command that will run daily to rename First Name_{date}.csv to FirstName_{date}.csv. The date in file name changes daily. For example,…
faujong
  • 949
  • 4
  • 24
  • 40
-3
votes
1 answer

rename file while uploading to avoid duplicate

Please i want to rename the files while uploading to avoid overwriting and make sure that the files are both on my server. I want it to be renamed by a unique name.
VASKOO
  • 5
-3
votes
1 answer

PHP renaming files after a limit

I want to make a php script that when the images folder has 30 images the next one uploaded becomes 1.JPEG and the rest go up one but the image which was 30.JPEG gets deleted because there is a 30 image limit. Would this even be possible to do? This…
Ben
  • 45
  • 9
-3
votes
1 answer

Beginner PowerShell Scripting

All, I am looking for a way to create a file every hour which captures the output of 24 commands. These commands will output the status of replication for 24 consistency groups into the same file. The file or the information in the file needs to…
-3
votes
2 answers

Windows 7 64 Bit/Save mode: Rename msi.dll not possible

Due to problems with the windows installer 5 I must rename msi.dll for reinstallation. That's not possible in save mode/as administrator (access denied). Of course the service is stopped. Any hints? Edit: My problem is that I can't install msi files…
ANTLRStarter
  • 309
  • 1
  • 4
  • 16
-4
votes
1 answer

How to rename folders with name DD.MM.YYYY-X to YYMMDDIX on bash?

I have folders inside a directory with names having the pattern DD.MM.YYYY-X where X refers to an index from 0-9 to distinguish folders with names having the same date. How could I use regex on bash to replace this pattern with YYMMDDIX where I is…
Our
  • 986
  • 12
  • 22
1 2 3
99
100