News for hackers. Stuff that matters.
Re:Show HN: I wrote a program to convert lines of text into ... by birchb on Monday March 29, 2021 @10:53AM (#26622597)
Author 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.
Re:Show HN: I wrote a program to convert lines of text into ... by jarmitage on Monday March 29, 2021 @11:59AM (#26623775)
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 ... by birchb on Tuesday March 30, 2021 @07:33AM (#26633365)
Sorry macos people, I don't own an Apple. (Not strictly true, I have an iMac rescued from a dumpster, but it's running Ubuntu now). Apparently greadlink is available https://stackoverflow.com/a/4031502 for you.
Re:Show HN: I wrote a program to convert lines of text into ... by jedberg on Monday March 29, 2021 @11:56AM (#26623737)
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 ... by eevilspock on Tuesday March 30, 2021 @02:04AM (#26631620)
Re:Show HN: I wrote a program to convert lines of text into ... by birchb on Tuesday April 06, 2021 @06:30AM (#26710222)
Re:Show HN: I wrote a program to convert lines of text into ... by birchb on Tuesday March 30, 2021 @07:40AM (#26633418)
I refer you to the answer I gave earlier.
Re:Show HN: I wrote a program to convert lines of text into ... by inadequatespace on Monday April 05, 2021 @10:48PM (#26707457)
Ah yes, I was just thinking that this could be useful for `aws s3 ls` and similar.

(Really I just want `tree` on `s3`. There's `s3-tree` but that uses the entire bucket rather than a prefix)

Re:Show HN: I wrote a program to convert lines of text into ... by clankyclanker on Monday March 29, 2021 @10:07PM (#26630604)
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 ... by birchb on Tuesday March 30, 2021 @07:36AM (#26633397)
Grepping the _input_ is, like, Standard. Knowhatimean bruv?