My issue: I need to copy log files, all with identical names, but stored 1-deep in subdirectories, and change their names.
I'm copying from the a folder called Logfiles which contains a bunch of folders:
W3SVC114
, W3SVC1507562355
, W3SVC350179472
, etc.
Each of these folders will contain a file named: u_ex[YYMMDD].log
, where [YYMMDD] is a datestamp.
I need all of these logfiles in one folder. Since all names are identical I would like to add the directory name to the resulting file name, for example:
W3SVC1507562355/u_ex150407.log
becomes W3SVC1507562355_u_ex150407.log
How do I make all of these happen? I'm a bit out of my depth here... :-/