Grouping files and folders

I will highly appreciate if someone can help write the script as you have mentioned in one of your old posts here. My account is already linked.