Try out following code. setup DEST for actual location where you wanna put files. You need to put script in root directory of office/desk. For example it it is /home/tom/office/desk, put script in /home/tom, alternatively you can modify LIST=(find ...) to specify path.
Code:
#!/bin/bash
LIST=$(find . -iname "*.txt")
DEST="/tmp/test"
[ ! -d $DEST ] && mkdir $DEST || :
echo "Starting copy ..."
for f in $LIST
do
bdirs=$(echo $f | cut -d'/' -f2)
bdirm=$(echo $f | cut -d'/' -f3)
bfile=$(echo $f | cut -d'/' -f4)
[ ! -d ${DEST}/${bdirs}_${bdirm} ] && mkdir ${DEST}/${bdirs}_${bdirm} || :
/bin/cp -f $f ${DEST}/${bdirs}_${bdirm}/${bfile}
done
echo "Done! All files copied to $DEST"