Greetings!
I'm often renaming directories of files using a loop, and sed - as I'm sure many of us do; what I want to do now is rename files while performing basic subtraction on the numerals at a location in the file name.
Code:
files19.subfile9.2323.txt
files19.subfile9.2324.txt
files19.subfile9.2325.txt
I would like to subtract 49 from each file (there are thousands), so that the names are:
Code:
files19.subfile9.2274.txt
files19.subfile9.2275.txt
files19.subfile9.2276.txt
I've been trying various things, and it was getting more convoluted by the minute.
Could anyone suggest an elegant way to go about this?
Bookmarks