There's a tricky and crucial difference between the example data and the real data!
Tough challenge! I struggled to create the logic.
Tricky! So many different scenarios to keep in mind. Got first wrong earlier because I didn't think same directory names in different paths.
Definitely one to work through while not sleepy and a day where having the example input made checking the logic much easier
And created a batch macro to add up the nested directories.
After getting it easy for D6, D7 picks up again.
I have opted for flexibility and readability in building my solution, and inserted sort tools before Multi-row, as a best practice although they may not be strictly needed, so that I can flip between using/not using grouping in Multi-row. The downside is that a lot more tools are probably needed.
1) Step 1: Instead of getting the full path for every line, I opted to filter out the command lines to get the active directory at each command. Lesser lines = easier for me to read and debug the logic.
2) Step 2: Recombine the generate the full path for all files and sub-folders.
3) Generate (i) direct size and (ii) level for each file and sub-folder
4) Actual solving for Part 1 and Part 2
Iterative macro to calculate size of the sub-folders.
It's a tough one for me. Will have to figure out how the others managed to solve so parsimoniously!😎
My take for Day-7. I have the story first workflow worked with sample data but was failing with the actual data 😅🤣
Happy Analyzing :)
Cheers and have a nice day!