小编pen*_*nta的帖子

如何提取文件中两个\n之间的字符串

我有一个带模式的文件

    <span class="WebRupee">Rs.</span>\n29\n<br/><font style="font-size:smaller;font-weight:normal">\n3 days\n</font></td>, <td class="pricecell"><span class="WebRupee">Rs.</span>\n59\n<br/><font style="font-size:smaller;font-weight:normal">\n7 days\n</font></td>, <td class="pricecell"><span class="WebRupee">Rs.</span>\n99\n<br/><font style="font-size:smaller;font-weight:normal">\n12 days\n</font></td>
Run Code Online (Sandbox Code Playgroud)

我想要值 29、3 天、59 等。

基本上之间的价值 \n value \n

我咨询了很多地方,但我不知道如何转义 \n 字符。

我试过了:-grep -o '\n.*\n' o.txt 但没有用

grep bash shell-script quoting

7
推荐指数
1
解决办法
679
查看次数

标签 统计

bash ×1

grep ×1

quoting ×1

shell-script ×1