I am a heavy user for `find | xargs grep` -- this makes my life so much sweeter. Thank you @birchb!
Show HN: I wrote a program to convert lines of text into trees
11–20 of 58 posts
Re: Show HN: I wrote a program to convert lines of text into trees
#12One suggestion: it may help to generalize the newline as the node separator. You may already be doing this (my go is rusty) but instead of https://github.com/birchb1024/frangipanni/blob/7543b4ee15ae7... be able to override the "newline" as the node separator, like you've done with the "spacer" param.
What do you do when the same line is encountered?
Re: Show HN: I wrote a program to convert lines of text into trees
#13Somewhat unrelated: I discovered some time ago that the column command (from util-linux) can print trees of hierarchical data (up to 2 levels deep).
From the man page:
$ echo -e '1 0 A\n2 1 AA\n3 1 AB\n4 2 AAA\n5 2 AAB' | column --tree-id 1 --tree-parent 2 --tree 3
1 0 A
2 1 |-AA
4 2 | |-AAA
5 2 | `-AAB
3 1 `-AB
column(1): https://github.com/karelzak/util-linux/blob/master/text-util...Re: Show HN: I wrote a program to convert lines of text into trees
#14I always thought it was weird that "do one thing and one thing well" stopped short of dealing with tree representations on the commandline.
Re: Show HN: I wrote a program to convert lines of text into trees
#15I've been thinking about making something like this for a while, this is great! I always thought it was weird that "do one thing and one thing well" stopped short of dealing with tree representations on the commandline.
Re: Show HN: I wrote a program to convert lines of text into trees
#16This only happens every other decade or so.
Re: Show HN: I wrote a program to convert lines of text into trees
#17Maybe this is not super relevant, but my favorite hack is that any tree-like structure like this can be browsed with ncdu. Here's a gist for breaking down redis traffic by command for example: https://gist.github.com/petethepig/0f33c910fb2edad8969a5775e...
For the record, the relevant commands are
ncdu -o /tmp/files.json
and ncdu -f /tmp/files.jsonRe: Show HN: I wrote a program to convert lines of text into trees
#18Re: Show HN: I wrote a program to convert lines of text into trees
#19Maybe this is not super relevant, but my favorite hack is that any tree-like structure like this can be browsed with ncdu. Here's a gist for breaking down redis traffic by command for example: https://gist.github.com/petethepig/0f33c910fb2edad8969a5775e...
Re: Show HN: I wrote a program to convert lines of text into trees
#20```
```