Properly init filename variable to avoid crash.
Remove leading whitespace from data.
Don't close stdin.
Cleanup parsing error messages.

Output line number.
Limit size of line output in case of bad files.