1
我有几行文字如下之间递增的数字换行:我想创建一个包含文本的每一行
The cat and the mouse
Were in the house
They spotted some grouse
我希望把每一行文本之间的新行后的递增数“>”,使其看起来像这样
>1
The cat and the mouse
>2
Were in the house
>3
They spotted some grouse
我想这样做在perl如果可能的话是我能在Mac上运行它。谁能帮忙?
太棒了。那么我如何将结果保存到txt文件而不是在终端上打印? – 2014-09-28 14:59:13
@ user3632206你可以通过添加'> file2'将文件重定向到文件或者在编辑'perl -i -pe ..' – 2014-09-28 15:00:51
当投下正确答案时请发表评论。 – 2014-09-28 18:20:16