I have a large number of waveform records that have been saved as individual files in many directories.
The directory structure is \RawData\Cell01, \RawData\Cell02, \RawData\Cell03…\RawData\Cell99
The data files in each of these subdirectories are named Cellxx_00000_xxxxx.xxx except the first file which is Cellxx_00000.dat
For example I have a subdirectory \RawData\Cell01 that may contain several thousand files named Cell01_00000_00001.dat, Cell01_00000_00002.dat; Cell01_00000_00003.dat… Cell01_00000_04300.dat.
I would like to:
- remove the characters "_00000" from these files and rename them as: Cell01_00001.dat, Cell01_00002.dat, Cell01_00003.dat … Cell01_04300.dat, and
- copy the renamed files to subdirectory \RawData\Renamed\Cell01. The file Cell01_00000.dat must not be changed.
Does anyone have a code that could perform this task?
Best Answer