Questions tagged [jsonlines]

JSON Lines is a format for storing structured data that may be processed one record at a time. It is a convenient format for storing structured data that may be processed one record at a time. It works well with Unix-style text processing tools and shell pipelines.

This text format is documented at http://jsonlines.org/.

156 questions
-1
votes
1 answer

gzipped jsonlines file read and write in python

While this code reads and writes a jsonlines file. How to compress it? I tried directly using gzip.open but I am getting various errors. import json def dump_jsonl(data, output_path, append=False): """ Write list of objects to a JSON…
-1
votes
1 answer

Displaying two json lines

I want to produce a custom json line and display it together with another. I can only display one json line right now. I need to display the two sequentially. I'm adding property "index" to property "hits" with curl data.json | jq '{"index":…
Addibro
  • 107
  • 1
  • 8
-1
votes
2 answers
-1
votes
2 answers

Reading large json lines files in javascript / react

I got a large file (300MB) that is saved in jsonlines. Means the file containes thousands of javascript objects, separated by line breaks. Unfortunatelly I have no idea how to work with a file like this. Can anyone give me some kind of short…
Sinan Theuvsen
  • 193
  • 1
  • 3
  • 14
-2
votes
1 answer

how i can sort jsonl file by "timestamp" string?

have this example jsonl code and i try to sort this by timestamp {"log_level": "DEBUG", "timestamp": "2022-12-04 18:04:09", "message": "Fry saw a man on the Mars yesterday"} {"log_level": "INFO", "timestamp": "2022-12-03 11:21:35", "message":…
-3
votes
1 answer

Can jq produce output without newlines between fields, one line per record?

jq always produces output with newlines/returns between each field: jq ... foo.json { "Name": "stedolan", "RecordTimestamp": "2021-02-25T05:00:06.740+0000" } How can I make the output one line per record so that it looks…
eric
  • 755
  • 6
  • 11
1 2 3
10
11