Skip to content

Commit

Permalink
suggest jsonl extension instead of jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Oct 7, 2013
1 parent f8deb86 commit e240638
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ <h3>

</section>

<p>JSON Lines' biggest strength is in handling lots of similar nested data structures. One <code>.jl</code> file is much easier to handle than a directory full of XML files.</p>
<p>JSON Lines' biggest strength is in handling lots of similar nested data structures. One <code>.jsonl</code> file is much easier to handle than a directory full of XML files.</p>

<p>If you have large nested structures then reading the JSON Lines text directly isn't recommended. This is a shell alias you can use to make viewing large structures easier:</p>

<div class="highlight"><pre><span class="nb">alias </span><span class="nv">jlpretty</span><span class="o">=</span><span class="s1">'python -c"import sys,json; [0 for s in sys.stdin if sys.stdout.write(json.dumps(json.loads(s), sort_keys=True, indent=2, ensure_ascii=False) + chr(10))]"'</span>
<div class="highlight"><pre><span class="nb">alias </span><span class="nv">jsonlfmt</span><span class="o">=</span><span class="s1">'python -c"import sys,json; [0 for s in sys.stdin if sys.stdout.write(json.dumps(json.loads(s), sort_keys=True, indent=2, ensure_ascii=False) + chr(10))]"'</span>

cat winning_hands.jl | grep pair | jlpretty
cat winning_hands.jsonl | grep pair | jsonlfmt
</pre></div>

<div class="highlight"><pre><span class="p">{</span>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ <h3>
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.</p>

<p>JSON Lines files may be saved with the file extension <code>.jl</code>.</p>
<p>JSON Lines files may be saved with the file extension <code>.jsonl</code>.</p>

<p>Stream compressors like <code>gzip</code> or <code>bzip2</code>
are recommended for saving space, resulting in <code>.jl.gz</code> or <code>.jl.bz2</code> files.</p>
are recommended for saving space, resulting in <code>.jsonl.gz</code> or <code>.jsonl.bz2</code> files.</p>

<h3>
<a name="utf-8-encoding" class="anchor" href="#utf-8-encoding"><span class="octicon octicon-link"></span></a>UTF-8 Encoding</h3>
Expand Down

0 comments on commit e240638

Please sign in to comment.