Skip to content

Instantly share code, notes, and snippets.

@plamb
Created May 3, 2017 23:46
Show Gist options
  • Save plamb/b10a1db35ebea1164cee781ad72bf9e7 to your computer and use it in GitHub Desktop.
Save plamb/b10a1db35ebea1164cee781ad72bf9e7 to your computer and use it in GitHub Desktop.

Input file has records and subrecords

^RECORD(1,2,3,"key-1",1)
abc
^(2)
cde
^(3)
fgh
^(4)
ijk
^RECORD(1,2,3,"key-2",1)
lmn
^(2)
opq
^(3)
rst
^(4)
uvw

transform to something like:

["key-1": ["abc","cde","fgh","ijk"], "key-2": ["lmn","opq","rst","uxw"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment