I have a file of id\'s that are comma separated. I\'m trying to replace the commas with a new line. I\'ve tried:
sed \'s/,/\\n/g\' file
b
MacOS is different, there is two way to solve this problem with sed in mac
first ,use \'$'\n''
replace \n
, it can work in MacOS:
sed 's/,/\'$'\n''/g' file
the second, just use an empty line:
sed 's/,/\
/g' file
Ps. Pay attention the range separated by '
the third, use gnu-sed replace the mac-sed