我一直在尝试实现一个从 wordnet 的在线数据库读取的 bash 脚本,并且一直想知道是否有一种方法可以使用一个命令删除各种文本文件。
示例文件转储:
**** Noun ****
(n)hello, hullo, hi, howdy, how-do-you-do (an expression of greeting) "every morning they exchanged polite hellos"
**** Verb ****
(v)run (move fast by using one's feet, with one foot off the ground at any given time) "Don't run--you'll be out of breath"; "The children ran to the store"
**** Adjective ****
(adj)running ((of fluids) moving or issuing in a stream) "as mountain stream with freely running water"; "hovels without running water"
我只需要删除描述语法方面的行,例如
**** Noun ****
**** Verb ****
**** Adjective ****
所以我有一个干净的文件,只有单词的定义:
(n)hello, hullo, hi, howdy, how-do-you-do (an expression of greeting) "every morning they exchanged polite hellos"
(v)run (move fast by using one's feet, with one foot off the ground at any given time) "Don't run--you'll be out of breath"; "The children ran to the store"
(adj)running ((of fluids) moving or issuing in a stream) "as mountain stream with freely running water"; "hovels without running water"
语法术语周围的 * 符号让我在 sed 中绊倒。