473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extract lines between two pattern appears multiple times in a file

1 New Member
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:VOI CE_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:VOI CE_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 3992

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

Similar topics

13
15205
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 pattern can occur on any byte boundary in the file, so chunking through the code at 16 bytes a frame maybe a problem. The file itself isn't so large,...
8
11585
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 be updated when a group of items is copied. I can successfully do this with cursors, but am experimenting with a way to do it with a single update...
1
2813
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 instances - e.g., DEV, TEST, etc., as I see fit. However, when once instance has already been installed, the web setup project will not install...
0
1572
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 correct situations. Each time I visited certain pages, I noticed that the SP called by the ResetItemTimeout method was called multiple times in a...
6
9289
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 image many times in a page load, but rather once. Yefim
9
3169
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 load with different data (locations, departments, etc.).
2
2544
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 a treeview, it creates the TopLevel object and subscribes to the ObjectChanged Event. When the event is fired, I rebuild the treeview. If I...
5
7622
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 click again on that same button than it will open same form again in seperate window. But instead of that already open form comes.and so i couldn't open...
4
1964
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 ToolStripProgressBar. Setting two values during a process of 20 and 60, I see a bar for each value. Any suggestions are appreciated
3
1789
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
7502
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7434
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.