08-28-2010
Really impossible to give any suggestions without a sample of what you need to parse. Please post ten lines or so of the input text that you'll need to parse, and exactly what portions of the data, from which records (if there are multiple types of records in the data), that you'll need. It's also important to put the sample input inside of code tags (use the # button in the edit frame) so that spacing is preserved.
This User Gave Thanks to agama For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys!
I want to extract table from PDF in HTML. Can we do this using Shell script....??. Please provide me your suggestions. Any help will be highly appreciated. Thanks! (2 Replies)
Discussion started by: parshant_bvcoe
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I need to extract the table name from an oracle control file which comes as the last word in the third line.
Ex:
LOAD DATA
INFILE '/home/user/files/scott.dat'
INTO TABLE SCOTT.EMP_SAL
FIELDS TERMINATED BY..........
what i want to to is write the table name SCOTT.EMP_SAL to a... (2 Replies)
Discussion started by: mwrg
2 Replies
3. Shell Programming and Scripting
Suppose there is a table like the following...I just wanted to know if there is any command using which we can get the record/name of the person who joined before 2005..
Sl Name des y.o.joining
1 Ram Engineer 2001
2 Hari Doctor 2004
3 David Plumber 2005
4 Rahim painter 2007
5 gurmeet... (1 Reply)
Discussion started by: satyajit007
1 Replies
4. Shell Programming and Scripting
I have an Employee with EID, ENAME and ESTATUS as columns in SQL.
I want to extract the status of an employee and update the details if the status is 'A'.
Can anyone help in writing the shell script. (1 Reply)
Discussion started by: vkca
1 Replies
5. Shell Programming and Scripting
I need to compare the 2 mysql database tables. there are around 50 tables in each DB.
my idea is
in DB1
extract result select * from table1; to alog file1
in DB2
extract result select * from table1; to alog file2
now compare log file 1 file 2
pls help me out ...
thanks in advance (5 Replies)
Discussion started by: kalyankalyan
5 Replies
6. Shell Programming and Scripting
Hi,
i want to extract the 'CREATE INDEX' or 'CREATE UNIQUE INDEX' statements from a ddl file and output each match to a separate file. i was looking around the net but couldnīt find anything.
a possible sed-script could be:
sed -n '/CREATE*INDEX*/,/COMMIT/p' filename.ddlbut i couldnīt find out... (11 Replies)
Discussion started by: CactusMoon
11 Replies
7. Shell Programming and Scripting
I have bash, awk, and sed available on my portable device. I need to extract 10 fields from each table row from a web page that looks like this:
</tr>
<tr>
<td>28 Apr</td>
<td><a... (6 Replies)
Discussion started by: rickgtx
6 Replies
8. UNIX for Dummies Questions & Answers
I want to extract a table from an HTML file. the table starts with
<table class="tableinfo"
and ends with next closing table tag
</table>
how can I do this with awk/sed...
---------- Post updated at 04:34 PM ---------- Previous update was at 04:28 PM ----------
also I want to... (4 Replies)
Discussion started by: koutroul
4 Replies
9. Shell Programming and Scripting
I need to sort out table in a file to a format below:
Input:
this is a test
example
Cat Bee Dat
1 2 3
more Example
date
data
Bet Cla Blaa Dat
A 6 T
data..
Output:
this is a test (10 Replies)
Discussion started by: aydj
10 Replies
10. Shell Programming and Scripting
Hi,
I need to extract only the create table structure with columns alone.
for eg
hive_table
show create table hive_table:
create table hive_table(id number,age number)
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat'
LOCATION 'hdfs:/path/'
I need only below
... (5 Replies)
Discussion started by: rohit_shinez
5 Replies
LEARN ABOUT SUSE
log::log4perl::config::baseconfigurator
Config::BaseConfigurator(3) User Contributed Perl Documentation Config::BaseConfigurator(3)
NAME
Log::Log4perl::Config::BaseConfigurator - Configurator Base Class
SYNOPSIS
This is a virtual base class, all configurators should be derived from it.
DESCRIPTION
METHODS
"new"
Constructor, typically called like
my $config_parser = SomeConfigParser->new(
file => $file,
);
my $data = $config_parser->parse();
Instead of "file", the derived class "SomeConfigParser" may define any type of configuration input medium (e.g. "url =>
'http://foobar'"). It just has to make sure its "parse()" method will later pull the input data from the medium specified.
The base class accepts a filename or a reference to an array of text lines:
"file"
Specifies a file which the "parse()" method later parses.
"text"
Specifies a reference to an array of scalars, representing configuration records (typically lines of a file). Also accepts a simple
scalar, which it splits at its newlines and transforms it into an array:
my $config_parser = MyYAMLParser->new(
text => ['foo: bar',
'baz: bam',
],
);
my $data = $config_parser->parse();
If either "file" or "text" parameters have been specified in the constructor call, a later call to the configurator's "text()" method
will return a reference to an array of configuration text lines. This will typically be used by the "parse()" method to process the
input.
"parse"
Virtual method, needs to be defined by the derived class.
Parser requirements
o If the parser provides variable substitution functionality, it has to implement it.
o The parser's "parse()" method returns a reference to a hash of hashes (HoH). The top-most hash contains the top-level keywords
("category", "appender") as keys, associated with values which are references to more deeply nested hashes.
o The "log4perl." prefix (e.g. as used in the PropertyConfigurator class) is stripped, it's not part in the HoH structure.
o Each Log4perl config value is indicated by the "value" key, as in
$data->{category}->{Bar}->{Twix}->{value} = "WARN, Logfile"
EXAMPLES
The following Log::Log4perl configuration:
log4perl.category.Bar.Twix = WARN, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::File
log4perl.appender.Screen.filename = test.log
log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout
needs to be transformed by the parser's "parse()" method into this data structure:
{ appender => {
Screen => {
layout => {
value => "Log::Log4perl::Layout::SimpleLayout" },
value => "Log::Log4perl::Appender::Screen",
},
},
category => {
Bar => {
Twix => {
value => "WARN, Screen" }
} }
}
For a full-fledged example, check out the sample YAML parser implementation in "eg/yamlparser". It uses a simple YAML syntax to specify the
Log4perl configuration to illustrate the concept.
SEE ALSO
Log::Log4perl::Config::PropertyConfigurator
Log::Log4perl::Config::DOMConfigurator
Log::Log4perl::Config::LDAPConfigurator (tbd!)
COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.1 2010-02-07 Config::BaseConfigurator(3)