I am trying to replace part of filenames based on matching string of filename from another file. Filenames are in following format: where digits before first _ represent station code, which I want to replace with its station name from another file named radiosonde.csv. For example : I want change 36872_201908…
Tag: file-rename
Recursively change file name in folder and subfolders without changing file path
I have files in a format like 639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The files reside in a folder and sub-folder format that resembles a date. ./2019/05/31/639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The goal is to remove everything before and including the _. Which im able to do with ren…
how to change a part in multiple filenames from 1 to 01?
I have lots of files in a directory. Example: here 9 represent the hour and change from 1 to 24,the date also change. the hours are represented .1. .2. .3. .4. …. .9. I want to replace this part(only this part) in the file name with .01. .02. .03. .04. …. .09. and do not touch any other number in
Modification of file names
I have a list of more than 1000 files on the following format. I am on Linux and want to change them as follows Using rename and awk I managed to get The remaining task is now to remove the last field that holds the year. Answer A solution that uses sed to generate the new names and the rename
Bash oneliner to rename filenames
I often would like to easily rename a bunch of files. I always have to struggle with find, grep, xargs and sed to simply to the job. I would like to understand how I can do a better job using PCRE Here my files: I would rename the dot files properly as I can do with this oneliner: However I
How to uppercase file name but exclude extension
Is it possible to use rename to uppercase a file but exclude its extension? ie: I want to rename the file foo_bar.ext to FOO_BAR.ext I tried with rename ‘y/a-z/A-Z/’ foo_bar.ext, but the whole file (including extension) gets uppercased FOO_BAR.EXT Answer You are asking rename to convert all the in…
Is rename() atomic?
I am not being able to check this via experiments and could not gather it from the man pages as well. Say I have two processes, one moving(rename) file1 from directory1 to directory2. Say the other process running concurrently copies the contents of directory1 and directory2 to another location. Is it possibl…