Questions tagged [ndjson]

NDJSON is a newline delimited JSON format.

NDJSON is a newline delimited JSON format. It is a convenient format for storing or streaming structured data that may be processed one record at a time. It works well with unix-style text processing tools and shell pipelines. It's a great format for log files. It's also a flexible format for passing messages between cooperating processes.

Spec: http://ndjson.org

119 questions
0
votes
0 answers

Loop through multiple .txt files in a folder, parse NDJSON strings and write .csv output files in R

I am new to coding currently working on a project, which requires me to parse NDJSON strings that are located in .txt files. I have hundreds of .txt files, each containing up to 1 million NDJSON strings. I have the below code, which I know parses…
0
votes
3 answers

jq add value of a key in nested array and given to a new key

I have a stream of JSON arrays like this [{"id":"AQ","Count":0}] [{"id":"AR","Count":1},{"id":"AR","Count":3},{"id":"AR","Count":13}, {"id":"AR","Count":12},{"id":"AR","Count":5}] [{"id":"AS","Count":0}] I want to use jq to get a new json like…
Eleanor
  • 2,647
  • 5
  • 18
  • 30
0
votes
1 answer

How do I parse this ndjson file in python?

I got this ndjson file from Google Quick draw dataset which is recently open sourced. I'm trying to make png image out of this co-ordinates. I need to parse this ndjson file in python [{'key_id': 5344373355053056, 'image': [((2, 38, 71, 108, 128,…
Neel Kadia
  • 11
  • 2
0
votes
1 answer

Pandas df to ndjson gives incorrect line count

I have a dataframe with 320 rows. I converted it to ndjson with pandas: df.to_json('file.json', orient='records', lines=True) However upon loading the data, I only obtain 200 rows. with open('file.json') as f: print(len(f.readlines())) gives…
hangc
  • 4,730
  • 10
  • 33
  • 66
0
votes
1 answer

How to import Newline Delimited JSON into Navicat or Bigquery

I am trying to import a ndjson file into either Navicat or Bigquery. Neither seem to have a option to allow for "array of strings" Is there any way to achieve this? or is there another tool that will allow this.JSON Value UUID string databaseID…
-1
votes
1 answer

How to configure output in NDJSON format with NLog

I am working on .NET Framework 4.5.2 NDJSON format I require : Nlog config in xml format for ndjson format given below { "timestamp": "[timestamp]", "level": "[level]", "severity": "[severity]", "requestId": "[requestId]", …
-1
votes
1 answer

How to access a ndjson file and find the oldest person, average age, youngest person in the country. Is it possible with python or javascript only

Is it possible to open with python or javascript if so, how do I access the file and find the data I want.
Hamsu
  • 11
-1
votes
1 answer

Converting a NDJSON to CSV in Python

Please could someone help me with convert this nested JSON to a CSV file? {"campaignTitle": "Template Campaign", "listName": "Trial", "leadId": 573, "timezone": "Australia/Sydney", "isComplete": 0, "customerKey": "576", "phone1": "+61212345678",…
Steeve_8
  • 19
  • 7
-1
votes
2 answers
-1
votes
1 answer

how to load or import a url in processing 3.4?

I am trying to load .ndjson files from Google Cloud to Processing 3.4 so that I can select one of the file from the cloud and use it. This is the code I tried: import cbl.quickdraw.*; JSONObject json; QuickDraw qd; void setup() { json =…
Ganesh Bhat
  • 246
  • 4
  • 19
-1
votes
1 answer

export nested JSON from GCS into Spreadsheet

I have a nested NDJSON file that I exported from BQ into Google Cloud Storage. From there I would like to open it in Spreadsheet again as a nested table. I see a lot of Appscripts to import JSON files but none are for files stored in GCS. What would…
-2
votes
1 answer

jsonObject.map is not a function

I am trying to convert a json to ndjson so that I can use it in BQ. The full script can be found here. When I run the conversion, I get the following error: "There was an error or your JSON is not valid. Details: jsonObject.map is not a function." I…
Fabien
  • 87
  • 8
-2
votes
1 answer

Raw Data Cleaning by R

I have a raw and low level text data file that contains Online Log data. I need to arrange these low level raw data and export the arranged data into a .csv file. The sample raw data is something like in the below. In the data, evendid is a column…
Tofazzal
  • 71
  • 8
1 2 3 4 5 6 7
8