I got struck in middle of a problem. I have the following data whose format is:
I wanted the output from this to be:
there can be any number of "a", "b","c","d"....might extened further to "e","f".........so on.
I wanted the last N (given 2 in the sample shown) lines from each "a","b","c"........
i had no clue where to start.
Can AWK do the job required ?
I donno but trying to learn it.
If anyone could give any idea, it would of great help.
dear ones
pl.kindly help me 1) how to print(grep) required pattern and following 2 or 3 lines. 2) grep required pattern(to print)+above 2 lines+below 2 or 3 lines.from a report file.
ex:
we have some report file
kf askfjsk fksaj fk skf sjfksjd kff sjfkjs kf jskdjfklsd jfklsdf sdkfjsd fsd... (3 Replies)
I have a files in a directory in this format
data
data
data
---BEGIN CERT-----
data
data
data
---END CERT -----
Now, I want to extract the lines starting from --BEGIN CERT-- and write the contents till the end of file into a new file.How can I do this for all the files in the... (1 Reply)
Hi,
I have a file with the following structure.
XXXXX...........
YYYYY...........
.................
..................
ZZZZZZ......
qwerty_start..............
..................
.................
..................
querty_end................
.............................. (1 Reply)
Hi ,
I have an XML like this.
<Request>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<version>v44</version><messageId>7247308192</messageId><timeToLive>72000000000</timeToLive>
</Request>.
I want to extract on version and messageId.
As in my output... (13 Replies)
Input file (4 DATA record shown in this case):
DATA AA0110
ACCESSION AA0110
VERSION AA0110 GI:157412239
FEATURES Location/Qualifiers
length 1..1170
1..1700
/length="1170"
position ... (5 Replies)
Dear all,
Greetings.
I would like to ask for your help to extract lines with specific words in addition 2 lines before and after these lines by using awk or sed.
For example, the input file is:
1 ak1 abc1.0
1 ak2 abc1.0
1 ak3 abc1.0
1 ak4 abc1.0
1 ak5 abc1.1
1 ak6 abc1.1
1 ak7... (7 Replies)
I have hundreds of files to process. In each file
I need to look for a pattern then
extract value(s) from next line and then
search for value(s) selected from point (2) in the same file at a specific position.
HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V
TITLE CYTOCHROME... (7 Replies)
Hi All,
I am new to AIX unix . i need to grep for a pattern and if pattern is found then i need 3 before the pattern line found and 3 lines after the pattern found. (11 Replies)
Data file example
I look for primary and * to isolate the interesting slot number.
slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'`
Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Discussion started by: popeye
2 Replies
LEARN ABOUT DEBIAN
configreader
ConfigReader(3) User Contributed Perl Documentation ConfigReader(3)NAME
ConfigReader - Read directives from a configuration file.
DESCRIPTION
The ConfigReader library is a set of classes which reads directives from a configuration file. The library is completely object oriented,
and it is envisioned that parsers for new styles of configuration files can be easily added.
ConfigReader::Spec encapsulates a specification for configuration directives. You can specify which directives can be in the configuration
file, aliases for the directive, whether the directive is required or has a default value, and how to parse the directive value.
Here's an example of how one directive might be specified:
required $spec 'HomePage', 'new URI::URL';
This defines a required directive called 'HomePage'. To parse the value from the configuration file, the URI::URL::new() method will be
called with the string value as its argument.
If the directive name is a simple string, it will be used both to refer to the directive in the Perl program, and as the name in the con-
figuration file. You can also specify an alias by using an array ref. For example, suppose you wanted to use "index" as the name of the
directive in the configuration file, but to avoid confusion with Perl's index() function you wanted to refer to the directive inside the
program as the "file_index". This will do the trick:
['file_index', 'index']
You can specify any number of aliases for the directive:
['file_index', 'index', 'file_index', 'contents', ...]
The parsing function or method is called to translate the value string from the configuration file into the value used by the program. It
can be specified in several different ways:
code ref static method object method undefined
You can also specify a default value to be used if a directive is not specified in the configuration file.
string value code ref undefined
ConfigReader::Values stores a set of directive values that have been read from a configuration file. It stores a reference to an associ-
ated Spec as a member variable. Separating the specification from the values makes it possible to use a single specification for multiple
sets of values.
ConfigReader::DirectiveStyle implements a reader for a common style of configuration file. It is a subclass of ConfigReader::Values.
Directive names are followed by their value, one per line:
HomePage http://www.w3.org/
Services /etc/services
perl v5.8.2 1996-02-14 ConfigReader(3)