【发布时间】:2013-09-25 14:29:21
【问题描述】:
我想从一个文件(一组 180 行)中提取前两行,这样,如果我将文件分组为 6-6 行,我将前两行作为我的输出。所以我应该能够得到第 1、2、然后是第 7、第 8 等等。我尝试为此使用 sed,但没有获得所需的输出。
有人可以建议在这里实现的逻辑
我的要求是对前两行进行一些修改(例如删除某些字符),每组 6 行。
例子:
This is line command 1 for my configuration
This is line command 2 for my configuration
This is line command 3 for my configuration
This is line command 4 for my configuration
This is line command 5 for my configuration
This is line command 6 for my configuration
我想要的输出是:
This is line command 1
This is line command 2
This is line command 3 for my configuration
This is line command 4 for my configuration
This is line command 5 for my configuration
This is line command 6 for my configuration
这必须对 180 个命令中的每 6 个命令重复一次。
【问题讨论】: