file parsing and length plotting