09-16-2008
Word "Person rejected:" may not be there everytime with the number.
So bifurcating the line based on "Person rejected:" does not seem to a good option to me..Instead i would prefer the line to be searched on basis of the number.
Hope i made my case clear
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies
2. Shell Programming and Scripting
Hello Team ,
I have to extract date section from the below file output. The output of the file is as shown below.
I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Discussion started by: coolguyamy
4 Replies
3. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
4. UNIX for Dummies Questions & Answers
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies
5. Programming
Hi ,
can any one tell me,"How to extract the same format from existing excel file to new excel file " using Spreadsheet::WriteExcel or Spreadsheet::ParseExcel module ???
Example_pgm:
Below program is used to read existing excel file..In this program "my $cell = $_;" line is used to... (0 Replies)
Discussion started by: kavi.mogu
0 Replies
6. Shell Programming and Scripting
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies
7. Shell Programming and Scripting
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies
8. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
9. UNIX for Beginners Questions & Answers
Hi All,
I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file.
comm -3 < sort file_old < sort file_new > new_file
I am getting the below error:
-ksh: sort: cannot open
But if I do... (7 Replies)
Discussion started by: njny
7 Replies
10. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
perlx::maybe
PerlX::Maybe(3pm) User Contributed Perl Documentation PerlX::Maybe(3pm)
NAME
PerlX::Maybe - return a pair only if they are both defined
SYNOPSIS
You once wrote:
my $bob = Person->new(
defined $name ? (name => $name) : (),
defined $age ? (age => $age) : (),
);
Now you can write:
my $bob = Person->new(
maybe name => $name,
maybe age => $age,
);
DESCRIPTION
Moose classes (and some other classes) distinguish between an attribute being unset and the attribute being set to undef. Supplying a
constructor arguments like this:
my $bob = Person->new(
name => $name,
age => $age,
);
Will result in the "name" and "age" attributes possibly being set to undef (if the corresponding $name and $age variables are not defined),
which may violate the Person class' type constraints.
(Note: if you are the author of the class in question, you can solve this using MooseX::UndefTolerant. However, some of us are stuck using
non-UndefTolerant classes written by third parties.)
To ensure that the Person constructor does not try to set a name or age at all when they are undefined, ugly looking code like this is
often used:
my $bob = Person->new(
defined $name ? (name => $name) : (),
defined $age ? (age => $age) : (),
);
or:
my $bob = Person->new(
(name => $name) x!!(defined $name),
(age => $age) x!!(defined $age),
);
A slightly more elegant solution is the "maybe" function:
"maybe $x => $y, @rest"
This function checks that $x and $y are both defined. If they are, it returns them both as a list; otherwise it returns the empty list.
If @rest is provided, it is unconditionally appended to the end of whatever list is returned.
The combination of these behaviours allows the following very sugary syntax to "just work".
my $bob = Person->new(
name => $name,
address => $addr,
maybe phone => $tel,
maybe email => $email,
unique_id => $id,
);
This function is exported by default.
BUGS
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=PerlX-Maybe <http://rt.cpan.org/Dist/Display.html?Queue=PerlX-Maybe>.
SEE ALSO
Syntax::Feature::Maybe.
MooseX::UndefTolerant, PerlX::Perform, Exporter.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
perl v5.14.2 2012-05-03 PerlX::Maybe(3pm)