I've got a long line that I want to insert a space every 4 characters, on a single lone line of solid text to make it easier to read, what's the simplest way to do this? also I should be able to input the line from a pipe. e.g.
echo "foobarbazblargblurg" | <some command here>
gives
foob arba zbla rgbl urg
Best Answer
Use sed as follows: