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
vote
1 answer

When extracting my .json.gz file, some characters are added to it - and the file cannot be stored as a json file

I am trying to unzip some .json.gz files, but gzip adds some characters to it, and hence makes it unreadable for JSON. What do you think is the problem, and how can I solve it? If I use unzipping software such as 7zip to unzip the file, this problem…
Mike Sal
  • 197
  • 1
  • 4
  • 13
1
vote
0 answers

Reading JSON output from database into PySpark

I'm trying to read some output from a SQL Server database into PySpark. The format of the data is as follows: { "var1": 0, "var2": 0, "var3": 1, "var4": null, "var5": 22156, "var6": 0, "var7": 1, "var8": "Denver", "var9":…
dmoors
  • 11
  • 2
1
vote
2 answers

Validate JSON fields sort order

I have the following JSON records stored in a container {"memberId":123,"memberCity":"Chicago","lastTransaction":1504155600000} {"memberId":123,"memberCity":"Chigago","lastTransaction":150175600000} {"memberId":123,"memberCity":"New…
rs79
  • 2,311
  • 2
  • 33
  • 39
1
vote
0 answers

Spark json schema for variable key

I have a json file as the following: { "123": [ { "id": "123", "info": { "op": { "m": 1, "q": 2 }, "li": [ "a", "b" ], "ad": [ { …
Pranaya Behera
  • 545
  • 1
  • 9
  • 24
1
vote
2 answers

Unexpected results when Select objects using jq

When I add the body to output list, some wrong names get output. I expected it to output only names for nfl subreddit in both examples. Feature or bug? How can I only output the tuples for subreddit nfl? The…
Geoffrey Anderson
  • 1,534
  • 17
  • 25
1
vote
1 answer

Append to array in json file from another json file with "jq"

i have a file "stats.json" with the following initial structure" [{ "price": 66.55, "created": "2018-02-24T14:32:57" }] With a bash/curl script i take every 10 minutes data from an api and save it to "temp.json" { "price": 88.55, "created":…
nelasx
  • 191
  • 1
  • 2
  • 9
1
vote
2 answers

Convert JSONL to JSON

Is there a way to convert JSONL to JSON in Linux with the full JSONL file depth? I found some methods based on jq but they don't work with full depth of JSONL file
Andrea993
  • 663
  • 1
  • 10
  • 23
0
votes
1 answer

Where is the character '\u201c'?

I'm trying to run finetuning on chatgpt and it keeps erroring my JSONL file out with the following error ... File…
0
votes
0 answers

How can I upload a JSONL file to write queries on in Valentina Studio?

How can I upload a JSONL file to Valentina Studio to write SQL queries on? I tried to load dump to a database, but it is not working.
Elif
  • 1
0
votes
0 answers

Convert list to JSON Lines file and write to Django FileField on S3

Let's say I have the following list of dicts: data = [ {"a": 1}, {"a": 1, "b": 2}, {"a": 1, "b": {"c": 3, "d": 4}}, ] And a simple model with a file field backed by S3: from storages.backends.s3boto3 import S3Boto3Storage class…
Johnny Metz
  • 5,977
  • 18
  • 82
  • 146
0
votes
1 answer

Angular : How to send JSONL String to a REST API endpoint (POST Method) that expects a file?

I am building an Angular App around OPENAI APIs and I have trouble with their Upload function. The Endpoint is called "files" and the documentation can be found here It works well when I perform the request from my computer using postman passing a…
0
votes
3 answers

Regex search for text then extract row

I have JSONL file as text - string, its a very big file and not useful to convert to standard…
Aleks Per
  • 1,549
  • 7
  • 33
  • 68
0
votes
0 answers

Search JSONL file using javascript or jquery

From an API I have data in JsonL format…
Aleks Per
  • 1,549
  • 7
  • 33
  • 68
0
votes
0 answers

How to convert json to ndjson using jf?

I wish to convert this JSON {"key1": {"a":1}, "key2": {"a":2}} to NDJSON: {"key":"key1", "a":1} {"key":"key2", "a":2} I could easily write python myself. But, how do I do this with jf?
dfrankow
  • 20,191
  • 41
  • 152
  • 214
0
votes
0 answers

How to convert dataframe to jsonl (json lines) objects without the brackets?

I'm trying to convert my dataframe to a json object, not sure why the columns has an extra bracket on them? My dataframe has 'description', 'name', 'screen_name', 'lang' columns and I used: df.to_json(orient='records', lines = True) The results I…