Sponsored Content
Top Forums Shell Programming and Scripting Search for Pattern and Print including Lines in between Post 302459672 by The One on Tuesday 5th of October 2010 07:21:24 AM
Old 10-05-2010
Search for Pattern and Print including Lines in between

Gurus,

I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below:

Code:
Name: xxxx yyyy nnnn
Description: dfffgs  sdgsgsf hsfhhs
afgghhjdgj
fjklllll   gsfhfh
Updated: jafgadsgg gsg
Corrected: date today

The file consists of line like these.

I want to only print out the line with the "Name" and "Updated" including all the lines between them.

Appreciate your help.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Print lines between the search pattern

hi, I have a file say x.txt containing xxx 123 bla bla ... you xxx dfk dbf ... me xxx ... ... keeps on.. i need to search for pattern in the line starting xxx in the file. If pattern matched, I need to fetch all the lines till i find next xxx. (17 Replies)
Discussion started by: prsshini
17 Replies

2. Shell Programming and Scripting

Search for a pattern in a file and print previous lines from a particular point

Hi, I am new to ksh scripting and I have a problem. I have a file in which I have to search for a particular pattern say 'a' then from that line I need to search for another pattern say 'b' in the previous lines and thne print the file from pattern 'b' till the end of file. For eg: ... (2 Replies)
Discussion started by: umaislearning
2 Replies

3. Shell Programming and Scripting

Print a pattern between the xml tags based on a search pattern

Hi all, I am trying to extract the values ( text between the xml tags) based on the Order Number. here is the sample input <?xml version="1.0" encoding="UTF-8"?> <NJCustomer> <Header> <MessageIdentifier>Y504173382</MessageIdentifier> ... (13 Replies)
Discussion started by: oky
13 Replies

4. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

5. Shell Programming and Scripting

Including EOL in egrep pattern for multiple lines

Hi all I need your help to get a high-performance solution. I am working on a extensive script to automate file restores using the bprestore tool on a Solaris 5.10 server (bash 3.00). I will only paste the needed parts of the script to avoid any confusion. To use the script the user has to... (2 Replies)
Discussion started by: Anonym
2 Replies

6. Shell Programming and Scripting

Search pattern on logfile and search for day/dates and skip duplicate lines if any

Hi, I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error. Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies

7. Shell Programming and Scripting

Search Pattern and Print lines in Single Column

Hi Experts I have small query where I request the into a single file Suppose: File1: {Unique entries} AA BB CC DD FileB: AA, 123 AA, 234 AA, 2345 CC, 123 CC, 5678 DD,123 BB, 7890 (5 Replies)
Discussion started by: navkanwal
5 Replies

8. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

9. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies
deb-changelog(5)						    dpkg suite							  deb-changelog(5)

NAME
deb-changelog - dpkg source packages' changelog file format SYNOPSIS
changelog DESCRIPTION
Changes in the packaged version of a project are explained in the changelog file debian/changelog. This includes modifications made in the source package compared to the upstream one as well as other changes and updates to the package. The format of the debian/changelog allows the package building tools to discover which version of the package is being built and find out other release-specific information. That format is a series of entries like this: package (version) distributions; metadata [optional blank line(s), stripped] * change-details more-change-details [blank line(s), included in output of dpkg-parsechangelog(1)] * even-more-change-details [optional blank line(s), stripped] -- maintainer-name <email-address> date package and version are the source package name and version number. distributions lists one or more space-separated distributions where this version should be installed when it is uploaded; it is copied to the Distribution field in the .changes file. metadata is a comma-separated list of keyword=value items. The only keywords currently supported by dpkg are urgency and binary-only. urgency's value is used for the Urgency field in the .changes file for the upload. binary-only with a yes value, is used to denote that this changelog entry is for a binary-only non-maintainer upload (an automatic binary rebuild with the only change being the changelog entry). The change details may in fact be any series of lines starting with at least two spaces, but conventionally each change starts with an asterisk and a separating space and continuation lines are indented so as to bring them in line with the start of the text above. Blank lines may be used here to separate groups of changes, if desired. If this upload resolves bugs recorded in the distribution bug tracking system, they may be automatically closed on the inclusion of this package into the distribution archive by including the string: Closes: Bug#nnnnn in the change details (the exact Perl regular expression is /closes:s*(?:bug)?#?s?d+(?:,s*(?:bug)?#?s?d+)*/i). This information is conveyed via the Closes field in the .changes file. The maintainer name and email address used in the changelog should be the details of the person who prepared this release of the package. They are not necessarily those of the uploader or usual package maintainer. The information here will be copied to the Changed-By field in the .changes file, and then later might be used to send an acknowledgement when the upload has been installed in the distribution archive. The date has the following format (compatible and with the same semantics of RFC2822 and RFC5322, or what <<date -R>> generates): day-of-week, dd month yyyy hh:mm:ss +zzzz where: day-of-week Is one of: Mon, Tue, Wed, Thu, Fri, Sat, Sun. dd Is a one- or two-digit day of the month (01-31). month Is one of: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec. yyyy Is the four-digit year (e.g. 2010). hh Is the two-digit hour (00-23). mm Is the two-digit minutes (00-59). ss Is the two-digit seconds (00-60). [+-]zzzz Is the time zone offset from Coordinated Universal Time (UTC). '+' indicates that the time is ahead of (i.e., east of) UTC and '-' indicates that the time is behind (i.e., west of) UTC. The first two digits indicate the hour difference from UTC and the last two digits indicate the number of additional minutes difference from UTC. The last two digits must be in the range 00-59. The first "title" line with the package name must start at the left hand margin. The "trailer" line with the maintainer and date details must be preceded by exactly one space. The maintainer details and the date must be separated by exactly two spaces. Any line that consists entirely (i.e., no leading whitespace) of # or /* */ style comments, RCS keywords, Vim modelines or Emacs local variables should be ignored. Ancient changelog entries with other formats at the end of the file should be accepted and preserved on output, but their contents might be otherwise ignored and parsing stopped at that point. The entire changelog must be encoded in UTF-8. FILES
debian/changelog EXAMPLES
dpkg (1.17.18) unstable; urgency=low [ Guillem Jover ] * Handle empty minimum versions when initializing dependency versions, as the code is mapping the minimum version 0 to '' to avoid outputting useless versions. Regression introduced in dpkg 1.17.17. Closes: #764929 [ Updated programs translations ] * Catalan (Guillem Jover). [ Updated dselect translations ] * Catalan (Guillem Jover). * German (Sven Joachim). -- Guillem Jover <guillem@debian.org> Sun, 12 Oct 2014 15:47:44 +0200 SEE ALSO
deb-version(7), deb-changes(5), dpkg-parsechangelog(1). 1.19.0.5 2018-04-16 deb-changelog(5)
All times are GMT -4. The time now is 11:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy