Split files based on file content and pattern matching

前端 未结 6 2082
执笔经年
执笔经年 2020-12-15 22:45

I need your help with formate a txt file using bash/linux. The file looks like the following, it always has a line called Rate: Sth then it follows with the details in the v

6条回答
  •  爱一瞬间的悲伤
    2020-12-15 23:13

    Another solution: It just makes your input file into a script and then runs it:

    sed 's/^Rate:/cat </; 1!s/^cat <

    I assumed the line numbers are not part of the file.

提交回复
热议问题