Parses json into flat file format