I don't care if I achieve this through vim, sed, awk, python etc. I tried in all, could not get it done.
For an input like this:
top f1 f2 f3
sub1 f1 f2 f3
sub2 f1 f2 f3
sub21 f1 f2 f3
sub3 f1 f2 f3
I want:
top f1 f2 f3
...sub1 f1 f2 f3
...sub2 f1 f2 f3
......sub21 f1 f2 f3
...sub3 f1 f2 f3
Then I want to just load this up in Excel (delimited by whitespace) and still be able to look at the hierarchy-ness of the first column!
I tried many things, but end up losing the hierarchy information