Hacker Newsnew | past | comments | ask | show | jobs | submit | wwader's commentslogin

Same! and jq's regexp functions are quite powerful for transforming text into something more structured:

  $ echo -e "10:20: hello\n20:39: world" | jq -cR 'capture("^(?<timestamp>.*): (?<message>.*)$")'
  {"timestamp":"10:20","message":"hello"}
  {"timestamp":"20:39","message":"world"}


  $ echo -e "10:20: hello\n20:39: world" | jq -Rn '[inputs | capture("(?<t>.*): (?<m>.*)$").m] | join(" ")'
  "hello world"
Also using inputs/0 etc in combination with reduce and foreach it's possible to process streams of text that might not end.


Very nice! thanks for building this


The jaq author is working on a formal specification of jq https://github.com/01mf02/jq-lang-spec. I think it has also help that there are several implementations of jq now like, gojq, jaq and jqjq, that has helped finding edge cases and weird behaviours.


The sqlite source includes a CLI tool called showdb that is quite nice for poking around in database files


Note on (b): As i understand it JSONPath by design is limited to only be able to select things from the input, so can't build a new object, array etc.


open -a is nice, i use it with alias, ex:

  alias qt='open -a "quicktime player"'
  alias vlc='open -a "vlc"'


At least for me (I've installed vlc via homebrew), there is a vlc binary in the PATH, and I can just vlc <filename>


The point here is to open a document with an app not assigned as default for the given mime-type by file name extension.


Yeap the syntax and semantics is quite different to other languages and it really took me a long time and deep understanding to really appreciate how expressive and damn well designed it is.


As a heavy jq user and now a days also maintainer i say welcome! happy to help if you run into some problem


Reminds me of the documentary Kim's video https://www.imdb.com/title/tt24132144/ recommended!


Great documentary, New York collector (Kim) gifts huge video library to an Italian town. When a former Kim's customer hunts it down, he finds water-damaged tapes in a disused store-room - and mafia overtones standing in his way!


Yeap love things like that, ex https://www.imdb.com/title/tt1787791/ and the mystery show podcast. Let me know if you know any!


I think the alpine package format do use this in combination with tar being similar https://wiki.alpinelinux.org/wiki/Apk_spec


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: