Update whitespace handling in data parsing task

The current behavior is too aggressive in removing whitespace, causing
spaces in the formatting strings to be removed inappropriately.

This replaces the `tr` call with a more explicit `gsub` targeting the
whitespace eliminations we actually care about.