开发者

Cut a file based on a text marker

I have a text file that has the following layout:

text
text
..
CUT HERE
text
text
..

The literal CUT HERE appears only once. What I want to do using shell scripting, is to produce another file containing all the text below CUT HERE, i.e. ignore whatever above CUT HERE.

开发者_开发问答

Thanks.


sed '0,/CUT HERE/d' file > new_file
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜