Renaming a file into folder based on name and parent

Hi,

you might find some help in this thread: Rename files using their parent folder