I am wanting to use sed to remove all space characters from a text file. At present I am using this:
sed 's/ //' test.txt > test2.txt
This works in the sense that it removes the first space character of each line but leaves the rest. Is there a way to tell sed to repeat for a space characters on a line before moving on to the next or is it a case of scripting multiple run thoughs on the same file? At present the file is small for testing but soon this will be ramped up on to much larger files so minimum rinse and repeat would be great. Any thoughts?
EDIT: At present I get this using the command above:
allthe kings men
ifi was a rich girl
When what I would like is this: