Whenever I provide a file to jq and use the inputs
command, I only get back all lines but the first one and I'm wondering why is that
I'm currently using jq 1.6 and I'm trying to use the inputs
command to convert a TSV (Tab Separated Values) into JSON by grabbing the first line of the file as the headers and placing each header as the key of the corresponding value in the next lines
If I execute the following
echo -n 'line1'$'\n''line2' | jq -R 'inputs'
The result is
line2
and not
line1
line2
as I'd expect
As a workaround I'm currently prepending a new line to the input i'm giving to jq as in
echo -n $'\n''line1'$'\n''line2' | jq -R 'inputs'
but my expectation is to be able to use inputs
and have it process the first line