HI
can any one tell me how to replace a delimiter : with another delimiter '\001' it is a non printable octal character.
thanks in adv
spandu (4 Replies)
Hi All,
I am having trouble through, I am reading the input from tab delimited file containing several records,
e.g.
line1 field1 field2 field3 so on..
line2 field1 field2 field3 so on..
..
..
on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)
Hi Everybody,
I need some help on formatting the files coming into unix box on the fly.
I get a file some thing like this in a single line.
ISA^M00^M ^M00^M ^M14^M006929681900 ^M01^M095449419 ... (5 Replies)
Hi,
I need to append the data in to a file by using tab delimiter.
eg:
echo "Data1" >> filename.txt
echo "\t" >> filename.txt (its not working)
echo "Data2" >> filename.txt.
the result sould be like this.
Data1 Data2 (6 Replies)
Hi,
I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
I’m new to Linux script and not sure how to filter out bad records from huge flat files (over 1.3GB each). The delimiter is a semi colon “;”
Here is the sample of 5 lines in the file:
Name1;phone1;address1;city1;state1;zipcode1
Name2;phone2;address2;city2;state2;zipcode2;comment... (7 Replies)
Hi,
I have a data file with :
01/28/2012,1,1,98995
01/28/2012,1,2,7195
01/29/2012,1,1,98995
01/29/2012,1,2,7195
01/30/2012,1,1,98896
01/30/2012,1,2,7083
01/31/2012,1,1,98896
01/31/2012,1,2,7083
02/01/2012,1,1,98896
02/01/2012,1,2,7083
02/02/2012,1,1,98899
02/02/2012,1,2,7083
I... (1 Reply)
A text file has 2 fields (Data, Filename) delimited by # as below,
Data,Filename
Row1 -> abc#Test1.xml
Row2 -> xyz#Test2.xml
Row3 -> ghi#Test3.xml
The content in first field has to be written into a file where filename should be considered from second field.
So from... (4 Replies)
Required No.of field = 12
Let say you got a “~” delimited input file and this file has 6 input fields and now I want to add 12-5=7 number of “~” into this input file in order to make it 12 fields
datafile can have n number of records
ex.,
a~b~c~d~12~r
a~b~c~d~12~r
a~b~c~d~12~r... (19 Replies)
We have the data looks like below in a log file.
I want to generat files based on the string between two hash(#) symbol like below
Source:
#ext1#test1.tale2 drop
#ext1#test11.tale21 drop
#ext1#test123.tale21 drop
#ext2#test1.tale21 drop
#ext2#test12.tale21 drop
#ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
LEARN ABOUT DEBIAN
mojolicious::plugin::config
Mojolicious::Plugin::Config(3pm) User Contributed Perl Documentation Mojolicious::Plugin::Config(3pm)NAME
Mojolicious::Plugin::Config - Perl-ish configuration plugin
SYNOPSIS
# myapp.conf
{
foo => "bar",
music_dir => app->home->rel_dir('music')
};
# Mojolicious
my $config = $self->plugin('Config');
# Mojolicious::Lite
my $config = plugin 'Config';
# Reads "myapp.conf" by default
my $config = app->config;
# Everything can be customized with options
my $config = plugin Config => {file => '/etc/myapp.stuff'};
DESCRIPTION
Mojolicious::Plugin::Config is a Perl-ish configuration plugin.
The application object can be accessed via $app or the "app" function. You can extend the normal configuration file "myapp.conf" with
"mode" specific ones like "myapp.$mode.conf". A default configuration filename will be generated by decamelizing the application class with
"decamelize" in Mojo::Util or from the application filename.
The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.
OPTIONS
Mojolicious::Plugin::Config supports the following options.
"default"
# Mojolicious::Lite
plugin Config => {default => {foo => 'bar'}};
Default configuration, making configuration files optional.
"ext"
# Mojolicious::Lite
plugin Config => {ext => 'stuff'};
File extension for generated configuration filenames, defaults to "conf".
"file"
# Mojolicious::Lite
plugin Config => {file => 'myapp.conf'};
plugin Config => {file => '/etc/foo.stuff'};
Full path to configuration file, defaults to the value of the "MOJO_CONFIG" environment variable or "myapp.conf" in the application home
directory.
METHODS
Mojolicious::Plugin::Config inherits all methods from Mojolicious::Plugin and implements the following new ones.
"load"
$plugin->load($file, $conf, $app);
Loads configuration file and passes the content to "parse".
sub load {
my ($self, $file, $conf, $app) = @_;
...
return $self->parse($content, $file, $conf, $app);
}
"parse"
$plugin->parse($content, $file, $conf, $app);
Parse configuration file.
sub parse {
my ($self, $content, $file, $conf, $app) = @_;
...
return $hash;
}
"register"
my $config = $plugin->register($app, $conf);
Register plugin in Mojolicious application.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojolicious::Plugin::Config(3pm)