01-24-2008
Concatenating multiple lines to one line if match pattern
Hi all,
I've been working on a script which I have hit a road block now. I have written a script using sed to extract the below data and pumped into another file:
Severity............: MAJORWARNING
Summary:
System temperature is out of normal range.
Severity............: MAJORWARNING
Summary:
Adapter at hardware path 0/4/1/0 : Received an interrupt indicating and
Elastic Store Error Storm
Severity............: MAJORWARNING
Summary:
Adapter at hardware path 0/3/1/0 : Received an interrupt indicating and
Elastic Store Error Storm
Severity............: MAJORWARNING
Summary:
System temperature is out of normal range.
I want to format it to look like this:
"Severity:.......... Summary:........"
"Severity:.......... Summary:........"
"Severity:.......... Summary:........"
"Severity:.......... Summary:........"
so that each ocurance will be in one line
Any ideas? Hope someone can help me quickly.
Thanks
phixsius.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello People,
Need some assistance/guidance.
OUTLINE:
Two files (File1 and File2)
File1 has some ids such as
009463_3922_1827
897654_8764_5432
File2 has things along the lines of:
Query= 009463_3922_1827 length=252
(252 letters)
More stufff here
... (5 Replies)
Discussion started by: Deep9000
5 Replies
2. Shell Programming and Scripting
Input
#GEO-1-type-1-fwd-Initial 890 1519
OPKHIJEFVTEFVHIJEFVOPKHIJTOPKEFVHIJTEFVOPKOPKHIJHIJHIJTTOPKHIJHIJEFVEFVOPKHIJOPKHIJOPKEFVEFVOPKHIJHIJEFVHIJHIJEFVTHIJOPKOPKTEFVEFVEFVOPKHIJOPKOPKHIJTTEFVEFVTEFV
#GEO-1-type-2-fwd-Terminal 1572 2030... (7 Replies)
Discussion started by: patrick87
7 Replies
3. Shell Programming and Scripting
I have sql file containing lot of queries on different database table. I have to filter specific table queries.
Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line.
Input file contains.
set INSERT_ID=1;
set... (1 Reply)
Discussion started by: mirfan
1 Replies
4. Shell Programming and Scripting
I have following pattern in a file:
00:01:38 UTC
abcd
00:01:48 UTC
00:01:58 UTC
efgh
00:02:08 UTC
00:02:18 UTC
and I need to change something like the following
00:01:38 UTC
abcd
00:01:48 UTC
XXXX
00:01:58 UTC
efgh
00:02:08 UTC
XXXX (6 Replies)
Discussion started by: jjnight
6 Replies
5. Shell Programming and Scripting
Data:
Pattern Data Data Data
Data Data Data
Data Data Data
...
With awk, how do I print the pattern matching line, then the subsequent lines following the pattern matching line. Varying number of lines following the pattern matching line. (9 Replies)
Discussion started by: dmesserly
9 Replies
6. Shell Programming and Scripting
I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched,
finally need to print these three values in a single line.
Sample Log:
2013/06/11 14:29:04 <0999> (725102) Processing batch 02_1231324
2013/06/11... (4 Replies)
Discussion started by: rpm120
4 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem.
interface FastEthernet0/8
spanning-tree portfast
interface FastEthernet0/9
spanning-tree... (4 Replies)
Discussion started by: mrlayance
4 Replies
9. Shell Programming and Scripting
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
10. Shell Programming and Scripting
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies
LEARN ABOUT PHP
monodocs2html
monodocs2html(1) General Commands Manual monodocs2html(1)
NAME
monodocs2html - Translate Monodoc XML to HTML
SYNOPSIS
monodocs2html -source:SOURCE_DIR -dest:DEST_DIR [OPTIONS]*
DESCRIPTION
monodocs2html has been obsoleted by mdoc(1). See the mdoc-export-html(1) man page.
monodocs2html is a program that creates HTML documentation from the Monodoc documentation XML files.
OPTIONS
-dest:DEST_DIR
Write the HTML files into the directory DEST_DIR .
-dumptemplate
Dump the default page template to standard output so that you can use it as a base for a new template for use with the -template
option.
-ext:FILE_EXTENSION
FILE_EXTENSION is the file extension for generated files.
This defaults to html .
-?, -help
Show program argument information.
-onlytype:TYPE
Only generate HTML for the type TYPE .
-source:SOURCE_DIR
SOURCE_DIR is the base directory containing the Monodoc XML documentation.
This directory should contain an index.xml file, the namespace-name.xml files (one for each namespace), and namespace-name directo-
ries (one for each namespace), which will contain the type.xml files holding the monodoc documentation.
-template:TEMPLATE
Generate HTML using the page template TEMPLATE .
-V, -version
Display version and licensing information.
TEMPLATE FORMAT
The template file is an XSLT which needs to process the following input XML document:
<Page>
<CollectionTitle>Collection Title</CollectionTitle>
<PageTitle>Page Title</PageTitle>
<Summary>Page Summary</Summary>
<Signature>Type Declaration</Signature>
<Remarks>Type Remarks</Remarks>
<Members>Type Members</Members>
<Copyright>Documentation Copyright</Copyright>
</Page>
The generated HTML also makes use of the following CSS classes, which should be defined so that output is nicely formatted:
.CollectionTitle
.PageTitle
.Summary
.Signature
.Remarks
.Members
.Copyright
.Section
.SectionBox
.NamespaceName
.NamespaceSummary
.MemberName
.MemberSignature
.MemberBox
.Subsection
.SubsectionBox
.SignatureTable
.EnumerationsTable
.CodeExampleTable
.MembersListing
.TypesListing
.InnerSignatureTable
.TypePermissionsTable
HTML LINKS
All members within the HTML file have a id attribute to permit linking to a specific member. The value of the id attribute is the String
ID of the specified member. See the STRING ID FORMAT section of the monodocer man page for more information.
MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details.
WEB SITE
Visit http://www.mono-project.com for details
monodocs2html(1)