Rename all files in subfolder with rootfolder_name_...

Hi there,
my name is Erik and I'm still a newbie to hazel, though I use it for some month. So most of the initial processes are quite clear to me.
But I have a special challenge and hope you can help me.
My monitored folder for the hazelrule is located in my homefolder and called “convert”.
It’s empty and for renaming purpose.
I will copy each of my customer-folder separately to the “convert” folder and let hazel do the rest.
When hazel has finished I move it back to the server (Just don't want to operate on live system...). That's my plan
My folder-hierarchy for every customer is the same:
/customer1:
/customer1/eol
/customer1/documentation
/customer1/internet-contracts
…
/customer2:
/customer2/eol
/customer2/documentation
/customer2/internet-contracts
…
All root- and subfolders contain .txt files that have to be:
*converted to docx (done
)
*renamed. All files (the names of the files are also the same in each customer folder) from e.g. firewall.docx to customer1_firewall.docx. Just the customer name as a prefix_
I managed to get the name from the customer folder (as monitored folder path) into the filename, replaced the “/” with "_", but as expected the filename contains the whole subfolder structure, in case of /customer1/documentation/firewall.docx the filename in the end is “customer1_documentation_firewall.docx”.
But I want to have only the customers root folder name, no matter in which subfolder the file lies.
And – btw – I would like to minimize using shell scripts, it’s not really my world.
If not possible without shell, maybe you have a good template… My colleague should be able to (at least) read it, evtly customize it. (I know - with shell I could read the foldername, print it into a variable and rename the files.)
Thx for your help!
erik
btw: High Sierra with all updates and hazel 4.2.4
my name is Erik and I'm still a newbie to hazel, though I use it for some month. So most of the initial processes are quite clear to me.
But I have a special challenge and hope you can help me.
My monitored folder for the hazelrule is located in my homefolder and called “convert”.
It’s empty and for renaming purpose.
I will copy each of my customer-folder separately to the “convert” folder and let hazel do the rest.
When hazel has finished I move it back to the server (Just don't want to operate on live system...). That's my plan

My folder-hierarchy for every customer is the same:
/customer1:
/customer1/eol
/customer1/documentation
/customer1/internet-contracts
…
/customer2:
/customer2/eol
/customer2/documentation
/customer2/internet-contracts
…
All root- and subfolders contain .txt files that have to be:
*converted to docx (done

*renamed. All files (the names of the files are also the same in each customer folder) from e.g. firewall.docx to customer1_firewall.docx. Just the customer name as a prefix_
I managed to get the name from the customer folder (as monitored folder path) into the filename, replaced the “/” with "_", but as expected the filename contains the whole subfolder structure, in case of /customer1/documentation/firewall.docx the filename in the end is “customer1_documentation_firewall.docx”.
But I want to have only the customers root folder name, no matter in which subfolder the file lies.
And – btw – I would like to minimize using shell scripts, it’s not really my world.
If not possible without shell, maybe you have a good template… My colleague should be able to (at least) read it, evtly customize it. (I know - with shell I could read the foldername, print it into a variable and rename the files.)
Thx for your help!
erik
btw: High Sierra with all updates and hazel 4.2.4