Gotcha.
A variant of the problem I had presented itself this morning.
While the solution to the spaces worked, I cannot implement it.
foo 3
foo 12
foo 123
Turns out, the text file needs to remain a fixed length per line, as it is imported into a database by column number.
In essence, all I am needing to do is split the file by the same 'foo' number... so I would end up with several fixed length text files with the same 'foo' numbers in them..
I was going to use grep with a redirect to a text file. So foo3.txt would include:
foo 3 ...
foo 3 ...
foo 3 ...
But, getting rid of the spaces, although great for the sorting, destroys the fixed length of each line.
Any ideas?