I want to come up with a sed command where once every 10 character will look for the nearest space and substitute it with "|"
I tried sed -E -e 's/ /|/\( *?[0-9a-zA-Z]*\)\{10,\}' new.file, but it shows errors.
Example input:
Hello there! How are you? I am trying to figure this out.
Expected Output:
Hello there!|How are you?|I am trying|to figure this|out.