Hi ppl,
I am a bit lost on this...can some one assist. I know this can be down with awk or sed, but i cant get the exact syntax right.
I need to only extract the numbers from a signle word ( eg abcd.123.xyz )
How can i extract 123 only ?
Thanks (14 Replies)
Hello,
I am new to sed and am trying to extract a word using sed.
for example i have a line "const TotalAmount& getTotalAmount() const; " in the file test.txt
I am trying to extract getTotalAmount() from the line.
For this i tried
cat test.txt | sed -n 's/.*get*\(\)//p
But... (8 Replies)
Hi,
I've searched the forum to get what I wanted but to no avail. Here's the problem I'm facing.
The line is suppose as below:
<INPUT DATABASE ="ORACLE" DBNAME ="UNIX" NAME ="FACT_TABLE" OWNERNAME ="DIPS">
Now I want to extract only FACT_TABLE. The trials are as follows:
awk... (3 Replies)
Hi,
i've a string
/u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD/TESi T_11_HD_120/hd-12
i need to get string, like
/u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD
the words from HD should get deleted, i need only a string till HD, i dont want to use any built in... (4 Replies)
$SET_PARAMS='-param Run_Type_Parm=Month -param Portfolio_Parm="997" -param From_Date_Parm="2011-08-09"'
Want to extract the value of "Portfolio_Parm" from $SET_PARAMS i.e in the above case "997" & assigned to new variable.
The existence order of "Portfolio"Parm" can change, but the name... (2 Replies)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
Hi
I need some lines of text from input file using keywords.
Inputfile
IP IS 10.238.52.65
pun-ras-bng-mhs-01#context bsnl.in
Card Status : 1:0, 2:1, 3:1, 4:1, 5:0, 6:0, 7:0,
8:0, 9:1, 10:0, 11:0, 12:0, 13:0, 14:1,
Max Circuits: 1: 0, 2: 32768, ... (5 Replies)
I have a sample text file with file name: sample.txt
The text file has the following text.
this is an example text where we have to extract certain words before and after certain word these words can be used later to get more information
I want to extract n (a constant) words before and... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies
LEARN ABOUT CENTOS
mail::spamassassin::timeout
Mail::SpamAssassin::Timeout(3) User Contributed Perl Documentation Mail::SpamAssassin::Timeout(3)NAME
Mail::SpamAssassin::Timeout - safe, reliable timeouts in perl
SYNOPSIS
# non-timeout code...
my $t = Mail::SpamAssassin::Timeout->new({ secs => 5, deadline => $when });
$t->run(sub {
# code to run with a 5-second timeout...
});
if ($t->timed_out()) {
# do something...
}
# more non-timeout code...
DESCRIPTION
This module provides a safe, reliable and clean API to provide alarm(2)-based timeouts for perl code.
Note that $SIG{ALRM} is used to provide the timeout, so this will not interrupt out-of-control regular expression matches.
Nested timeouts are supported.
PUBLIC METHODS
my $t = Mail::SpamAssassin::Timeout->new({ ... options ... });
Constructor. Options include:
secs => $seconds
time interval, in seconds. Optional; if neither "secs" nor "deadline" is specified, no timeouts will be applied.
deadline => $unix_timestamp
Unix timestamp (seconds since epoch) when a timeout is reached in the latest. Optional; if neither secs nor deadline is specified,
no timeouts will be applied. If both are specified, the shorter interval of the two prevails.
$t->run($coderef)
Run a code reference within the currently-defined timeout.
The timeout is as defined by the secs and deadline parameters to the constructor.
Returns whatever the subroutine returns, or "undef" on timeout. If the timer times out, "$t-<gt"timed_out()> will return 1.
Time elapsed is not cumulative; multiple runs of "run" will restart the timeout from scratch. On the other hand, nested timers do
observe outer timeouts if they are shorter, resignalling a timeout to the level which established them, i.e. code running under an
inner timer can not exceed the time limit established by an outer timer. When restarting an outer timer on return, elapsed time of a
running code is taken into account.
$t->run_and_catch($coderef)
Run a code reference, as per "$t-<gt"run()>, but also catching any "die()" calls within the code reference.
Returns "undef" if no "die()" call was executed and $@ was unset, or the value of $@ if it was set. (The timeout event doesn't count
as a "die()".)
$t->timed_out()
Returns 1 if the most recent code executed in "run()" timed out, or "undef" if it did not.
$t->reset()
If called within a "run()" code reference, causes the current alarm timer to be restored to its original setting (useful after our
alarm setting was clobbered by some underlying module).
perl v5.16.3 2011-06-06 Mail::SpamAssassin::Timeout(3)