wwader
Joined 4 years ago
Karma
298
Submissions
104
Member since
Dec 23
Joined 4 years ago
$ 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. alias qt='open -a "quicktime player"'
alias vlc='open -a "vlc"'