473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Extract lines between two pattern appears multiple times in a file

I am new to Perl scripting and I have file contains

File: input.log
DATE1=2018-05-24
DATE=2018-05-20
SETTING USER RELATED INFORMATION ..
SETTING USER RELATED INFORMATION ..

Database Connection Information

Database server = DB2/LINUXX8664 10.5.6
SQL authorization ID = ORV5_ETL
Local database alias = CHADDB

AIR_TCD_AIR_CS5
-------------------------------------------

1 2 3
------------------- ----------- -----------
2018-05-20-00.00.00 761 1186102
2018-05-21-00.00.00 773 1226970
2018-05-22-00.00.00 746 1158361
2018-05-23-00.00.00 767 1225759
2018-05-24-00.00.00 727 1123991

5 record(s) selected.

DB20000I The TERMINATE command completed successfully.
SETTING USER RELATED INFORMATION ..

Database Connection Information

Database server = DB2/LINUXX8664 10.5.6
SQL authorization ID = ORV5_ETL
Local database alias = CHADDB

AIR_TCD_CCN:VOICE_CS5
-------------------------------------------

1 2 3
------------------- ----------- -----------
2018-05-20-00.00.00 4554 7578729
2018-05-21-00.00.00 4533 7533879
2018-05-22-00.00.00 4399 7349718
2018-05-23-00.00.00 4597 7781008
2018-05-24-00.00.00 4411 7344806

5 record(s) selected.


I have to extract below Output but it is reading all content writing in output file.

Output should be as below:

AIR_TCD_AIR_CS5
-------------------------------------------

1 2 3
------------------- ----------- -----------
2018-05-20-00.00.00 761 1186102
2018-05-21-00.00.00 773 1226970
2018-05-22-00.00.00 746 1158361
2018-05-23-00.00.00 767 1225759
2018-05-24-00.00.00 727 1123991

AIR_TCD_CCN:VOICE_CS5
-------------------------------------------

1 2 3
------------------- ----------- -----------
2018-05-20-00.00.00 4554 7578729
2018-05-21-00.00.00 4533 7533879
2018-05-22-00.00.00 4399 7349718
2018-05-23-00.00.00 4597 7781008
2018-05-24-00.00.00 4411 7344806
May 30 '18 #1
0 3941

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: yaipa | last post by:
What would be the common sense way of finding a binary pattern in a ..bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the...
8
by: pb648174 | last post by:
I have a single update statement that updates the same column multiple times in the same update statement. Basically i have a column that looks like .1.2.3.4. which are id references that need to...
1
by: Luther Miller | last post by:
I've created a web setup project that works great for installing an ASP.NET application to a virtual directory on a server. I'd like to be able to use the same setup program to install multiple...
0
by: Jonathan Duke | last post by:
I have written a custom session state provider that stores session data in XML in a SQL database , and I was running the SQL profiler to verify that all of my stored procedures were called in the...
6
by: yk | last post by:
Hi, Is it a technique available in html/javascript in order to display same image many many times on a same page? Because of a large page loading I am looking for a way not to have same...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: AMDRIT | last post by:
Hello Everyone, I am having an issue where an event appears to be fired repeatedly where I only expect it to be fired once. See below for objects and behaviors. I have a control that contains...
5
by: billa856 | last post by:
Hi, My project is in MS Access 2002. In that I want to open one form multiple times. I put one button on my main form. Now whenever I click on that button than form will be open. Now when I...
4
by: matt65 | last post by:
I am having an issue where each time I set a Value to the progress bar, a new bar is painted in the StatusStrip control on my WinForm. I am using default properties for both the StatusStrip and...
3
by: beary | last post by:
Hi, If I have this: Today is a good day Johnny is good Tomorrow will be better Mary is bad Who cares
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.