[英]Linux: How to strip actual data apart from header and trailer
I have a file which has data contains headers(some message) , actual data and then trailer(with some message) I want to strip only the actual data. 我有一个文件,其中的数据包含标头(一些消息),实际数据,然后是拖车(有一些消息),我只想剥离实际数据。
I found the below command which does the purpose. 我找到了以下目的的命令。
sed -n '/. sed -n'/。 [0-9]{9}. [0-9] {9}。 [0-9]{10}.*/p' abc.txt>abc_new.txt [0-9] {10}。* / p'abc.txt> abc_new.txt
file looks like this. 文件看起来像这样。
Mc38749-001 Set Up Process Page: 86 Tax Services Cancellation and Exception Process Run Date: 01/30/12 Source : 52A abc compnany Detail Report Run Time: 03:24:27 Customer: 438540 abc company Mc38749-001设置过程页面:86税务服务取消和例外过程运行日期:01/30/12来源:52A abc公司详细报告运行时间:03:24:27客户:438540 abc公司
Bus. Order Order Srvc Loan Excptn
Count State Source Number Date Loan Id Request Type Type Code Message 计数状态源编号日期贷款编号请求类型类型代码消息
1 AB 354039865 11/30/18 34547896 1 C S01 Needs Legal - System Suspension
Mc38749-001 Set Up Process Page: 87 Tax Services Cancellation and Exception Process Run Date: 01/30/12 Source : 52A abc compnany Detail Report Run Time: 03:24:27 Customer: 438540 abc company Mc38749-001设置过程页面:87税务服务取消和例外过程运行日期:01/30/12来源:52A abc公司详细报告运行时间:03:24:27客户:438540 abc公司
Bus. Order Order Srvc Loan Excptn
Count State Source Number Date Loan Id Request Type Type Code Message 计数状态源编号日期贷款编号请求类型类型代码消息
I want the data in the file like this.(its a single line) 我想要这样的文件中的数据(单行)
1 AB 354039865 11/30/18 34547896 1 C S01 Needs Legal - System Suspension 1 AB 354039865 11/30/18 34547896 1 C S01需要法律-系统暂停
Can any of you please decode what this does. 你们中的任何一个都可以解码它的功能吗?
Thanks in advance 提前致谢
仅对1和AB之间的一定数量的空白字符进行grep并将其流式传输到新文件,可能会起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.