format lines of text into textual hash format for json, python, or perl