grep contig lengths and write to Json