09-18-2012
cool.. much clear, easy and very few lines of code.. Thank you rdrtx1
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Please help me out with a script which checks whether a given file say abc.txt is in ASCII format and data is tab-delimited. If the condition doesn't satisfy then it should generate error code "100" for file not in ASCII format and "105" if it is not in tab-delimited format.
If the... (9 Replies)
Discussion started by: Mandab
9 Replies
2. Shell Programming and Scripting
I would like to remove characters from column 7 so that from an input file looking like this:
>HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD
I get something like that in an output file:
... (13 Replies)
Discussion started by: matlavmac
13 Replies
3. Shell Programming and Scripting
I have a large text-file with tab-delimited genetic data that looks like:
KSC112 KSC234 0 0 1 1 A G C T
I simply wan to delete the first column, but since the file has 600 000 columns, it is not possible with awk (seems to be limited at 32k columns).
Does anyone have an idea how to do this? (2 Replies)
Discussion started by: andmal
2 Replies
4. UNIX for Dummies Questions & Answers
How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
5. UNIX for Dummies Questions & Answers
Hello gurus,
I have a file in a tab delimited format and a header row. I need a code to delete the header in the file, and convert the file to a fixed width format, with all the columns aligned. Below is a sample of the file:... (4 Replies)
Discussion started by: chumsky
4 Replies
6. Shell Programming and Scripting
Hi,
Can anyone please tell me about how we can delete an entire column from a tab delimited file?
Mu input_file.txt looks like this:
And I want the output as:
I used the below code
nawk -v d="1" 'BEGIN{FS=OFS="\t"}{$d=""}{print}' input_file.txtBut in the output, the first column is... (5 Replies)
Discussion started by: sampoorna
5 Replies
7. Shell Programming and Scripting
Hi all ,
I have a file having 12 columns tab delimited .
I need to read this file and remove the column 3 and column 4 and insert a word in column 3 as "AVIALABLE "
Is there a way to do this . I am trying like below
Thanks
DJ
cat $FILENAME|awk -F"\t" '{ print $1 "\t... (3 Replies)
Discussion started by: Hypesslearner
3 Replies
8. UNIX for Dummies Questions & Answers
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
9. UNIX for Beginners Questions & Answers
Hi there,
I would like to use awk to reformat a tab-delimited file containing three columns as follows:
Data file:
sample 1 173
sample 269 530
sample 687 733
sample 1699 1779
Desired output file:
sample 174..265, 531..686, 734..1698
I need the value... (5 Replies)
Discussion started by: emiley
5 Replies
10. UNIX for Beginners Questions & Answers
Hello Everyone..
I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files
FileP.txt
... (2 Replies)
Discussion started by: YogeshG
2 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)