我正在尝试使用 sed 删除多行的开头。目标是删除每一行中的所有字符,直到一个具有两个连续大写字母的单词。
输入将始终类似于:
1 where did you get ACQUIRE, obtain, come by, receive, gain, earn, win, come into, take
2 I got your letter: RECEIVE, be sent, be in receipt of, be given.
3 your tea is getting cold: BECOME, grow, turn, go.
4 get the children from school: FETCH, collect, go for, call for, pick up, bring, deliver, convey, ferry, transport.
5 the chairman gets £650,000 a year: EARN, be paid, take home, bring in, make, receive, collect, gross; informal pocket, bank, rake in, net, bag.
6 have the police got their man?: APPREHEND, catch.
我希望输出是:
ACQUIRE, obtain, come by, receive, gain, earn, win, come into, take
RECEIVE, be sent, be in receipt of, be given.
BECOME, grow, turn, go.
FETCH, collect, go for, call for, pick up, bring, deliver, convey, ferry, transport.
EARN, be paid, take home, bring in, make, receive, collect, gross; informal pocket, bank, rake in, net, bag.
APPREHEND, catch.
我必须建立这个:
sed -n 's/^.*[A-Z]\{2\}//p'
但是这个表达式也删除了大写的单词。关于如何做到这一点的任何线索?