我有這個代碼和平:sed的 - 未結束的'S'命令
cat BP.csv | while read line ; do
goterm=$(awk '{print $1}') ;
name=$(awk '{print $2}') ;
grep -w "$goterm" GOEA.csv | sed "s/$goterm/pi/g" ;
done
文件BP.csv
具有以下格式:
GO:0008283 cell proliferation
GO:0009405 pathogenesis
GO:0010201 response to continuous far red light stimulus by the high-irradiance response system
GO:0009641 shade avoidance
而GOEA.csv
具有以下格式:
4577 GO:0006807 0.994 2014_06_01
4577 GO:0016788 0.989 2014_06_01
4577 GO:0043169 0.977 2014_06_01
4577 GO:0043170 0.963 2014_06_01
sed
不起作用。我想改變GO:0043170
例如,字符串「圓周率」,但它給:
sed: -e expression #1, char 12: unterminated `s' command
爲什麼? 謝謝。
goterm的價值是什麼? –
@Avinash拉傑,真的嗎?你不能看到goterm是文件BP.csv的第一列嗎? – user2979409
Ick,你知道這兩個'awk'命令都是從'stdin'讀取的,而不是'$ line'變量,對吧? – ams