Whats a good way of “collapsing“ subfolders of a specified directory into a single folders whose name is a join the subfolders?
So given this directory structure…
./zero.csv
./reports/r1/a/b/c/one.csv
./reports/r2/a/two.csv
./reports/r3/x/y/z/three.csv
./reports/r4/x/y/four.csv
How could I specify subfolders of./reports should collapse - resulting in:
./zero.csv
./reports/r1.a.b.c/one.csv
./reports/r2.a/two.csv
./reports/r3.x.y.z/three.csv
./reports/r4.x.y/four.csv
Thanks