Whoa, he wrote a parser. This only happens every other decade or so.
You've been breaking the site guidelines badly. If you keep doing this we will have to ban you. Please review https://news.ycombinator.com/newsguidelines.html and stick to the rules from now on.
Show HN: I wrote a program to convert lines of text into trees
41–50 of 58 posts
Re: Show HN: I wrote a program to convert lines of text into trees
#42Author here: Often I have to digest log files and lists of Azure resource names. I prefer to work with hierarchies of things, so I wrote this simple filter. Turns out to quite handy, especially when combined with awk and its friends.
Great, very handy! Just FYI `readlink -f` doesn't work on macOS May I suggest the name txtree?
Re: Show HN: I wrote a program to convert lines of text into trees
#43Author here: Often I have to digest log files and lists of Azure resource names. I prefer to work with hierarchies of things, so I wrote this simple filter. Turns out to quite handy, especially when combined with awk and its friends.
I love this as a post-processor for log-files. We actually have something like this at work. Unfortunately, it's applied to log-files by default. It's terrible: it breaks grep, and I haven't been able to figure a way around that. Have you found any solutions for grepping on matching lines? Presumably, one could use awk, but awk takes a lot of cycles.
Re: Show HN: I wrote a program to convert lines of text into trees
#44Author here: Often I have to digest log files and lists of Azure resource names. I prefer to work with hierarchies of things, so I wrote this simple filter. Turns out to quite handy, especially when combined with awk and its friends.
Very cool tool! Any chance that you're going to add it to Homebrew?
Re: Show HN: I wrote a program to convert lines of text into trees
#45Neat. I'll add this to my toolbox. Somewhat 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
#46Awesome. You really nailed it. In my experience the output for spreadsheets turns out to be key so good job highlighting that ( https://github.com/birchb1024/frangipanni#output-for-spreads... ). One 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 th…
Re: Show HN: I wrote a program to convert lines of text into trees
#47Awesome. You really nailed it. In my experience the output for spreadsheets turns out to be key so good job highlighting that ( https://github.com/birchb1024/frangipanni#output-for-spreads... ). One 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 th…
really cool! But I think you should have called it "birch"! :) Any way you could add build instructions to the README?
Re: Show HN: I wrote a program to convert lines of text into trees
#48In retrospect, it’s not clear to me why I somehow expected this project to be something more literally arboreal. I even got my hopes up further when I clicked the link and saw that photo of plumerias. Yet, this project is cool enough that I’m not even disappointed.
Re: Show HN: I wrote a program to convert lines of text into trees
#49$ find /etc/network | ./frangi.tl etc: network: if-post-down.d: wireless-tools wpasupplicant avahi-daemon if-down.d: resolvconf wpasupplicant avahi-autoipd interfaces.d interfaces if-pre-up.d: wireless-tools wpasupplicant ethtool if-up.d: ntpdate wpasupplicant 000resolvconf openssh-server ethtool avahi-autoipd slrn avahi-daemon $ find /etc/network | ./frangi-cheat.tl /etc/network /if-post-down.d /wireless-tools /wpas…
C version. Maybe this logic should be built into GNU find as an option! $ find /etc/network | ./frangi-cheat /etc/network /if-post-down.d /wireless-tools /wpasupplicant /avahi-daemon /if-down.d /resolvconf /wpasupplicant /avahi-autoipd /interfaces.d /interfaces /if-pre-up.d /wireless-tools /wpasupplicant /ethtool /if-up.d /ntpdate /wpasupplicant /000resolvconf /openssh-server /ethtool /avahi-autoipd /slrn /avahi-daem…
Re: Show HN: I wrote a program to convert lines of text into trees
#50What a beautiful idea. Like the application of quick analysis of ls or logs. Although now we are typically outputting JSON and collecting for Kibana.