{"id":359,"date":"2016-07-14T10:39:31","date_gmt":"2016-07-14T00:39:31","guid":{"rendered":"http:\/\/chuchuva.com\/pavel\/?p=359"},"modified":"2016-07-19T15:03:36","modified_gmt":"2016-07-19T05:03:36","slug":"how-to-view-large-json-files-on-windows","status":"publish","type":"post","link":"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/","title":{"rendered":"How to View Large JSON Files on Windows"},"content":{"rendered":"<p>Let&#8217;s say you need to view a huge (more than 1 GB) JSON file. Of course you are not going to view so much data, it&#8217;s humanly impossible. What you want to do is to get a general understanding of JSON structure.<\/p>\n<p>I assume that JSON document is already properly formatted.<\/p>\n<p>First of all we will copy first 10,000 lines to a new file. We will user PowerShell for that:<\/p>\n<p><code><\/p>\n<pre>Get-Content large.json -TotalCount 10000 | Out-File truncated.json<\/pre>\n<p><\/code><\/p>\n<p>Next, open truncated.json in <a href=\"https:\/\/www.sublimetext.com\/\">Sublime Text Editor<\/a> and scroll to the end:<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"362\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/sublime-truncated-json\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-truncated-json.png?fit=712%2C285&amp;ssl=1\" data-orig-size=\"712,285\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sublime-truncated-json\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-truncated-json.png?fit=604%2C242&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-truncated-json.png?resize=604%2C242\" alt=\"sublime-truncated-json\" width=\"604\" height=\"242\" class=\"alignnone size-full wp-image-362\" srcset=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-truncated-json.png?w=712&amp;ssl=1 712w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-truncated-json.png?resize=300%2C120&amp;ssl=1 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/p>\n<p>The JSON is not valid right now. Let&#8217;s make it valid by closing all &#8216;<code>[<\/code>&#8216; and &#8216;<code>{<\/code>&#8216; brackets. Sublime Text has a great feature that highlights invalid JSON code:<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"361\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/sublime-invalid-json-highlighted\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-invalid-json-highlighted.png?fit=463%2C252&amp;ssl=1\" data-orig-size=\"463,252\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sublime-invalid-json-highlighted\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-invalid-json-highlighted.png?fit=463%2C252&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-invalid-json-highlighted.png?resize=463%2C252\" alt=\"sublime-invalid-json-highlighted\" width=\"463\" height=\"252\" class=\"alignnone size-full wp-image-361\" srcset=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-invalid-json-highlighted.png?w=463&amp;ssl=1 463w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-invalid-json-highlighted.png?resize=300%2C163&amp;ssl=1 300w\" sizes=\"auto, (max-width: 463px) 100vw, 463px\" \/><\/p>\n<p>All you need to do is to try to add brackets alternating between &#8216;<code>[<\/code>&#8216; and &#8216;<code>{<\/code>&#8216; until you reach the first column:<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"363\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/sublime-valid-json\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-valid-json.png?fit=662%2C409&amp;ssl=1\" data-orig-size=\"662,409\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sublime-valid-json\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-valid-json.png?fit=604%2C373&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-valid-json.png?resize=604%2C373\" alt=\"sublime-valid-json\" width=\"604\" height=\"373\" class=\"alignnone size-full wp-image-363\" srcset=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-valid-json.png?w=662&amp;ssl=1 662w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/sublime-valid-json.png?resize=300%2C185&amp;ssl=1 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/p>\n<p>Now you can save the file and open it in <a href=\"https:\/\/jsonviewer.codeplex.com\/\">JSON Viewer<\/a>. Since the new file is small you should have no problems viewing it as tree:<br \/>\n<a href=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"360\" data-permalink=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/json-viewer-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png?fit=765%2C751&amp;ssl=1\" data-orig-size=\"765,751\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"json-viewer\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png?fit=604%2C593&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png?resize=604%2C593\" alt=\"json-viewer\" width=\"604\" height=\"593\" class=\"alignnone size-full wp-image-360\" srcset=\"https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png?w=765&amp;ssl=1 765w, https:\/\/i0.wp.com\/chuchuva.com\/pavel\/images\/2016\/07\/json-viewer-1.png?resize=300%2C295&amp;ssl=1 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/p>\n<p>By the way, I&#8217;m thinking of building a tool that would automate this process &#8211; leave a comment if you&#8217;re interested in learning more.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say you need to view a huge (more than 1 GB) JSON file. Of course you are not going to view so much data, it&#8217;s humanly impossible. What you want to do is to get a general understanding of JSON structure. I assume that JSON document is already properly formatted. First of all we &hellip; <a href=\"https:\/\/chuchuva.com\/pavel\/2016\/07\/how-to-view-large-json-files-on-windows\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to View Large JSON Files on Windows<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[33],"class_list":["post-359","post","type-post","status-publish","format-standard","hentry","category-software","tag-json"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/comments?post=359"}],"version-history":[{"count":0,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/posts\/359\/revisions"}],"wp:attachment":[{"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/media?parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/categories?post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chuchuva.com\/pavel\/wp-json\/wp\/v2\/tags?post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}