in reply to Text File Parsing.

Leading whitespace removal is easy as that's just s/^\s+//;, as for "proper formatting", it's up to you as to how you want it formatted