Welcome to Mac-Forums.
Unless you have compressed files here, what you are talking about is not extracting, but rather copying files..
You will probably not be able to do what you want from the UI or Finder, but rather through a shell script or something..
For example, assume you have 10 directories with 10 files (named the same to make it complicated) like this:
.:
one two three four five six seven eight nine ten
./one:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./two:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./three:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./four:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./five:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./six:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./seven:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./eight:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
./nine:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
.ten:
fileOne fileTwo fileThree fileFour fileFive fileSix fileSeven fileEight fileNine fileTen
You first get a list of all the files with:
Code:
find . -type f > file.list
Now this script will iterate over each of the files and copy them to the local (root) directory by prefixing the directory name to each file so you know where it came from. I'm only dealing with files one level deep, if you have files that are multi-directory deep, you'll have to modify the script accordingly..
Code:
for file in `cat file.list`;
do d=`echo $file | sed -e 's/\// /g'`;
dir=`echo $d | awk '{print $2}'`;
f=`echo $d | awk '{print $3}'`;
echo "Moving $file to $dir-$f";
mv $file $dir-$f;
done
You might have to not add the "mv $file $dir-$f" portion of the script and just see what the echo is going to show you to ensure that the files are being moved properly..
Also, you might want to play around with this script in a separate test folder until you're sure it's doing what you want before running it on the real folders..