0

I am extracting a large quantity of data from a Database in JSON format. 3 Million + rows, the resulting text file weighs ~4GB. I wish to split the resulting JSON file into one JSON file per "DATE_JR".

The schema looks like this:

{
"ID": "ABC000011512221",
"DATE_JR": "2017-04-01",
"TYPE": "Balloon",
"XELL": "AB-123",
"QRSX": "QRSXA",
"CAT1": "1st one",
"CAT2": "2nd one",
"CAT3": "3rd one",
"CODE_MUK": "Some Code",
"DATE_HR": "2017-04-01 19:27:38",
"GEO_LONG": "-87.5060503076923",
"GEO_LAT": "62.2202423846154"
}

The Data is Ordered by ID, which is also an ID generated in chronological order, so DATE_JR and DATE_HR also ordered.

I saw this code : https://stackoverflow.com/a/41505542/4254078 from @Ansgar Wiechers which looks close to what I need but not quite.

Some PowerShell Guru could shed some light?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Altheran
  • 3
  • 4
  • 1
    Please shows us what you've tried so far and how the output files should be named. As a general pointer: please read about [how to ask a good question](http://stackoverflow.com/help/how-to-ask). – mklement0 Apr 29 '19 at 21:10
  • What do you mean when you say _close to what I need but not quite_ about Ansgars answer? Why does that not work for you? – Theo Apr 30 '19 at 13:22
  • So um, The output of my extract is exactly as this : [ { Stuff }, { Stuff } ] No text before the data, no "Type" or "Feature". So in his code .... Select-Object -Expand features | ... } -Expand Features : I have nothing to expand then after I am simply at a loss. I understand variables ($xxxx) Starting to get a hold of "Foreach", but how is each-object different ? "-f ($i++)" and after ? No signal in the brain XD I want to split my json data (Many days worth of data) into 1 file per day : 2019-01-01.json, 2019-01-02.json, etc ... Thanks! – Altheran May 02 '19 at 21:06

0 Answers0