title: Using jq how can I split a very large JSON file into multiple files, each a specific quantity of objects?
body: <p>I have a large JSON file with I'm guessing 4 million objects.  Each top level has a few levels nested inside.  I want to split that into multiple files of 10000 top level objects each (retaining the structure inside each).  jq should be able to do that right?  I'm not sure how.</p>
  
  <p>So data like this:</p>
  
  <pre><code>[{
    "id": 1,
    "user": {
      "name": "Nichols Cockle",
      "email": "ncockle0@tmall.com",
      "address": {
        "city": "Turt",
        "state": "Thị Trấn Yên Phú"
      }
    },
    "product": {
      "name": "Lychee - Canned",
      "code": "36987-1526"
    }
  }, {
    "id": 2,
    "user": {
      "name": "Isacco Scrancher",
      "email": "iscrancher1@aol.com",
      "address": {
        "city": "Likwatang Timur",
        "state": "Biharamulo"
      }
    },
    "product": {
      "name": "Beer - Original Organic Lager",
      "code": "47993-200"
    }
  }, {
    "id": 3,
    "user": {
      "name": "Elga Sikora",
      "email": "esikora2@statcounter.com",
      "address": {
        "city": "Wenheng",
        "state": "Piedra del Águila"
      }
    },
    "product": {
      "name": "Parsley - Dried",
      "code": "36987-1632"
    }
  }, {
    "id": 4,
    "user": {
      "name": "Andria Keatch",
      "email": "akeatch3@salon.com",
      "address": {
        "city": "Arras",
        "state": "Iracemápolis"
      }
    },
    "product": {
      "name": "Wine - Segura Viudas Aria Brut",
      "code": "51079-385"
    }
  }, {
    "id": 5,
    "user": {
      "name": "Dara Sprowle",
      "email": "dsprowle4@slate.com",
      "address": {
        "city": "Huatai",
        "state": "Kaduna"
      }
    },
    "product": {
      "name": "Pork - Hock And Feet Attached",
      "code": "0054-8648"
    }
  }]
  </code></pre>
  
  <p>Where this is a single complete object:</p>
  
  <pre><code>{
    "id": 1,
    "user": {
      "name": "Nichols Cockle",
      "email": "ncockle0@tmall.com",
      "address": {
        "city": "Turt",
        "state": "Thị Trấn Yên Phú"
      }
    },
    "product": {
      "name": "Lychee - Canned",
      "code": "36987-1526"
    }
  }
  </code></pre>
  
  <p>And each file would be a specified number of objects like that.</p>