I try to replace the char # with a newline \n:
sed -e "s/#/\n/g" > file.txt
this works fine.
Now there is problem with the char #, when is escaped with -:
eg.: 123#456-#789#777 should be:
123
456#789
777
The escaped char - itself can also be escaped:
eg.: 123#456-#789–012#777 should be:
123
456#789-012
777
How can i do this with sed ?
First part is to preserve
-<any chars>and convert#(without the preceding-) to newline, second part is to convert-<any chars>to only<any chars>(If you don’t need such wildcard, I think you know how to modify for only-and#.)