unix - sed 替换为回车符

标签 unix sed

Sed 用回车符替换。

我的文件:

<ABC>123</ABC><ABC>456</ABC>

我想这样输出:

<ABC>123</ABC>
<ABC>456</ABC>

我正在使用:

sed "s/<ABC>///n/g" 

但没有任何变化。

最佳答案

尝试如下

sed -e 's/></>\n</g' file.txt > output.txt

关于unix - sed 替换为回车符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33138574/

相关文章:

linux - 在 shell 脚本中与 expr 相乘

c - shutdown(2) 系统调用对我不起作用;我不确定我做错了什么

linux - Cat 命令给出 "No such file or directory"

linux - 如何在 linux 的 find 命令中解析密码?

linux - 为什么 UnZip 提取最后一个串联的 ZIP?

regex - 无法使用 AWK 读取两个模式之间的行

linux - grep后如何过滤部分行

regex - 帮助 SED 语法 : unterminated `s' command

Sed:在最后一次出现后追加

macos - 从 CSV 中删除\r (CR)