所以,我有一个看起来像这样的字符串:
AUGGCCAUGGCGCCCAGAACUGAGAUCAAUAGUACCCGUAUUAACGGGUGA
Run Code Online (Sandbox Code Playgroud)
我想将字符串拆分为由 '+' 符号分隔的 3 个字符的块。
AUG+GCC+AUG+GCG+CCC+AGA+ACU+GAG+AUC+AAU+AGU+ACC+CGU+AUU+AAC+GGG+UGA
Run Code Online (Sandbox Code Playgroud)
我想和我的好朋友一起做sed
。
我试过
cat codons | sed -r 's/([A-Z]\{3\})/\1\+/g'
Run Code Online (Sandbox Code Playgroud)
……没有成功。
我sed
可以使用什么命令?
我的数据看起来像:
$ cat input
1212103122
1233321212
0000022221
Run Code Online (Sandbox Code Playgroud)
我希望输出看起来像:
$ cat output
1 2 1 2 1 0 3 1 2 2
1 2 3 3 3 2 1 2 1 2
0 0 0 0 0 2 2 2 2 1
Run Code Online (Sandbox Code Playgroud)
我试过:
sed -i 's// /g' input > output
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
有什么建议?