rename

How to rename an already existing blob in azure storage explorer using python

How to rename an already existing blob in azure storage explorer using python Question: I want to rename a blob file in Azure storage explorer. It’s in a folder of a specific blob container.I’m using python. I used this code. sourceFileName = abc.xlsx destinationFileName = xyz.xlsx sourcePath = ‘cloudops-resources/outputs/’ destinationPath = ‘cloudops-resources/outputs/’ blob_url = blob_service.make_blob_url(sourcePath,sourceFileName) …

Total answers: 1

Python – importing and re-writing multiple CSV files

Python – importing and re-writing multiple CSV files Question: I have a number of csv files that I would like to read, remove the empty columns and rewrite each to a separate file. So far in Jupyter Notebook I can do this for a single file without any problems: from pandas.io.parsers import read_csv data = …

Total answers: 1

Rename all csv files in folder by removing the end of the filename

Rename all csv files in folder by removing the end of the filename Question: I have an entire data folder ending with .csv. All csv files are named like this : "data_AA_10_344362.csv" "data_AA_25_124567.csv" "data_AA_37_896432.csv" etc. I want to rename all of them by removing everything after the last underscore but keep ‘.csv’. So i would …

Total answers: 2

Python – file name adjustments

Python – file name adjustments Question: I have a number of csv files (6) in a Linux folder that I need to rename and relocate to a new folder on the same server. <entity_name>_yyyymmdd_hhmmss.csv – bearing in mind the <entity_name> is a string that varies from file to file. I need to be able to …

Total answers: 1

Renaming characters in multiple files in a folder

Renaming characters in multiple files in a folder Question: I’m trying to rename files in a folder with import os. Folder I want to replace the ‘SN’ in all these files with ‘NG’. I have tried with the code ` filenames = os.listdir(serial_dir) #serial_dir is the right path for filename in filenames: dst = filename.replace(‘SN’, …

Total answers: 1

python rename image in a folder

python rename image in a folder Question: I’m trying to rename all files in a folder (suppose the name is already sorted from 0 – 20), I want to rename them starting at a specified number. It really changes all images’ names but the order is messed up. Right after it changes the name of …

Total answers: 1

mp3 file name replace

mp3 file name replace Question: So my concern on a logic of a program. I have a Music folder with many mp3 files with underscores in names (MC_-_Best_track.mp3). So I want to scan this folder and replace all underscores with whitespaces. I want to write it myself first but I need a kickstart for that) …

Total answers: 1

Looping through and renaming files is actually deleting them too. why?

Looping through and renaming files is actually deleting them too. why? Question: I’m looping through files in a directory and changing their names to 1, 2, 3, etc. When I run it once it works fine. But if I run it again it ends up deleting a lot of the files. Can’t figure out why. …

Total answers: 1

How to rename images in folder?

How to rename images in folder? Question: I have a folder which contains images. The name is like this : ID03_013_bmp.rf.1d3821394d2c0b482202e204edde93b1.jpg I want to rename each image, save 8 first characters and remove the rest. and thank you. Asked By: ramy || Source Answers: You can use the following script, which uses the os standard …

Total answers: 2