简体   繁体   English

Linux:如何将实际数据与标题和尾部分开

[英]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.

相关问题 Linux-根据带有头和尾的键位置对文件排序 - Linux - Sort a File based on key position with header and trailer 如何用新的标头和尾部字符串替换目录中所有文件的标头和尾部,但最多只能确定一个字符? - How do I replace the header and trailer of all files in a directory with a new header and trailer string, but only up to a certain character? 使用Linux将预告片添加到csv - Add trailer to csv using Linux 我如何从Java获取Linux机器中的实际IP - How can I get the actual IP in a linux machine from Java 如何在Linux中将相同的标头数据附加到一个标头 - how to append same header data to one header in linux 从 linux 共享库中剥离调试信息 - Strip debug info from linux shared library 除了 POSIX 计时器,Linux 中的其他计时器 API 是什么? - What are the other timer APIs in Linux apart from POSIX timers? 如何精简我的Yocto Linux? - How to strip down my Yocto Linux? 在Linux中,如何去除ASCII文件中的所有高位,而保留其余位? -与ISTRIP类似,但带有文件 - In Linux, how do I strip all the high bits from an ascii file but keep the rest of the bits? - Like ISTRIP but with files linux中是否有一种简单的方法可以从命令行中删除文本网站? - Is there a simple way in linux to strip a website of text from command line?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM