I am trying to scrub some lists into a properly formatted CSV file for database import.
My starting file, looks something like this with what is supposed to be each &
The following works on Oracle Linux, x8664:
$ echo 'foobar' | sed 's/foo/foo\n/' foo bar
If you need it to match more than once per line, you'll need to place a g at the end, as in:
g
$ echo 'foobarfoobaz' | sed 's/foo/foo\n/g' foo barfoo baz