I\'ve used a grep command with sed and cut filters that basically turns my output to something similar to this
this line 1 this line 2 another li
I would do this, short and simple:
sed 's: ::g'
Add this at the end of your command, and all whitespace will go poof. For example try this command:
cat /proc/meminfo | sed 's: ::g'