如何在没有任何分隔符的情况下垂直连接两个文件?我尝试使用paste -d"" a b,但这只是给了我a.
示例文件:
000 0 0 0
0001000200030004
10 20 30 40
2000 4000
.123
12.1
1234234534564567
Run Code Online (Sandbox Code Playgroud) 我正在尝试在casestartStr和endStrcase之间获取所有内容bbb。我明白,我怎么能得到之间的所有事件startStr和endStr使用sed。我不明白我如何将它限制在bbb发生的一个实例上。
样本输入:
fff
startStr
aaa
bbb
ccc
endStr
xxx
yyy
startStr
ddd
endStr
ddd
bbb
Run Code Online (Sandbox Code Playgroud)
所需输出:
startStr
aaa
bbb
ccc
endStr
Run Code Online (Sandbox Code Playgroud)
这就是我所拥有的:
$ sed -n -e '/startStr/,/endStr/ p' sample.txt
startStr
aaa
bbb
ccc
endStr
startStr
ddd
endStr
Run Code Online (Sandbox Code Playgroud)