S
Simon Harrison
This came up at work a while ago and our IT dept. said it was
impossible. If we have the following paths:
dir/customer1/file1
dir/customer1/file2
dir/customer1/lots more files
dir/customer2/file1
dir/customer2/file2
dir/customer2/file3
dir/customer2/obsolete/file1
dir/customer2/oblolete/file2
dir/customer3/file1
dir/customer3/file2
dir/customer3/obsolete/file1
..etc
how can we end up with this:
/newdir/obsolete/customer2/file1
/newdir/obsolete/customer2/file2
/newdir/obsolete/customer3/file1
..etc
I can't really experiment at work because the IT folk would probably not
be best pleased if I delete everything. I'm not sure what to use. I can
get the paths easily with Dir.glob and then grep for 'obsolete'. But,
I've no idea how to rename the paths. Any help appreciated.
impossible. If we have the following paths:
dir/customer1/file1
dir/customer1/file2
dir/customer1/lots more files
dir/customer2/file1
dir/customer2/file2
dir/customer2/file3
dir/customer2/obsolete/file1
dir/customer2/oblolete/file2
dir/customer3/file1
dir/customer3/file2
dir/customer3/obsolete/file1
..etc
how can we end up with this:
/newdir/obsolete/customer2/file1
/newdir/obsolete/customer2/file2
/newdir/obsolete/customer3/file1
..etc
I can't really experiment at work because the IT folk would probably not
be best pleased if I delete everything. I'm not sure what to use. I can
get the paths easily with Dir.glob and then grep for 'obsolete'. But,
I've no idea how to rename the paths. Any help appreciated.