我有一个带有以下文本的文本文件
Query= gi_4849 ref_YP_00.1_ flagellar assembly protein H[Bacillus]--
Query= gi_4851 ref_YP_00.1_ MS-ring protein[Bacillus]--
Query= gi_4852 ref_YP_00.1_ flagellar hook-basal body proteinFliE [Bacillus]--
Query= gi_4851 ref_YP_00.1_ [membrane protein][Bacillus]--
.
.
.
期望的输出:
flagellar assembly protein H
MS-ring protein
flagellar hook-basal body proteinFliE
[membrane protein]
.
.
.
我试过以下命令;
sed '/.1_/,/[Bacillus/p' filename > new
sed '/".1_"/,/"[Bacillus"/p' filename > new
awk '/.1_/,/[Bacillus/' filename > new
awk '/".1_"/,/"[Bacillus"/' filename > new
但awk
不工作并sed
给出错误。
sed: -e expression #1, char 19: unterminated address regex