Hi,

On Thu, Feb 10, 2011 at 9:06 AM, Brad Baxter <b...@mail.libs.uga.edu> wrote:
> I had also thought about how to separate JSON records in a single file.
> Perhaps this has been solved already, but I haven't seen a reference
> to it.  If it were YAML, you could simply put "\n---\n" between the JSON
> objects, and it would be simple to scan for that.

A couple ways to go about it:

[1] Simply define a collection of MARC-in-JSON records as an array and
use a progressive JSON parser to handle large collections.
[2] Use newline-delimited JSON, i.e., eliminate interior newlines and
just read or write MARC-in-JSON records under the assumption each
record occupies one line in the file.

The first is slightly more time-consuming to implement but ensures
that MARC-in-JSON files are always conformant JSON.  The latter is
easier and can Get Things Done quicker but produces output that can't
be handled correctly by just any random JSON parser.

Regards,

Galen
-- 
Galen Charlton
gmcha...@gmail.com

Reply via email to