12-12-2013
awk help string capture
Dear All
First code take space as delimiter and second one is given error.
Kindly suggest some another alternative.
Regards
Jaydeep
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
ghkjkjoj (4 Replies)
Discussion started by: chetankelvin
4 Replies
2. Shell Programming and Scripting
Hi,
I wanted to know how i could accomplish this in a script using ksh.
Lets say there is a file called test.dat and it has a certain input like below :
.
.
Hi = 56
Hi = 67
.
.
1 record(s) selected
Now i need to capture the numbers after the = sign and store them in a... (3 Replies)
Discussion started by: Siddarth
3 Replies
3. UNIX for Advanced & Expert Users
Hi,
I have a query as follows :
suppose I am matching a string in a file say "start from here"
and I want to pick up 'n' number of lines () from the matched string. Is there any way to do that ?
1) going forward I want to do this for every match for the above string
2) or limit this to... (2 Replies)
Discussion started by: sumoka
2 Replies
4. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
5. Shell Programming and Scripting
Hello All,
I'm working on a script that runs the wget command on a list of IP Address in order to capture the data at that address' index.html.
That part works fine to get the HTML code at that address but the data I'm trying to pull out is on a line containing a BUNCH of
code for an HTML... (4 Replies)
Discussion started by: mrm5102
4 Replies
6. Shell Programming and Scripting
Hi all,
My file :test.txt just like this:
...........................
From: 333:123<sip:88888888888@bbbb.com
To: <sip:123456@aaaaa.com
.........................
I want a script to capture the string between sip: & @
Expect output:
88888888888
123456
Please help! (4 Replies)
Discussion started by: Alex Li
4 Replies
7. Shell Programming and Scripting
Dear All
From below mention input file I want op file as mention. Kindly help.
IP file:
"BSCGNR4_IPA17_C" 329 140119 0717 RXOCF-105 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN
Needed OP:
140119 0717 KJO001_BASC_NG AC FAULTY DG ON DOOR OPEN
Note that string mark in red as variable in... (3 Replies)
Discussion started by: jaydeep_sadaria
3 Replies
8. Shell Programming and Scripting
Hi,
I need to collect IP address of all servers (more than 300). One way is put it in for loop and run nslookup for that servers list, but there are multiple fields in output.
(tty/dev/pts/13): bash: 1011 > nslookup vplssor04
Server: 10.58.115.34
Address: 10.58.115.34#53
Name: ... (7 Replies)
Discussion started by: solaris_1977
7 Replies
9. Shell Programming and Scripting
Dear all,
I have a log file to be analysed. this log file contains vaiours lines of code starting with date timestamp.
if my search string is exception then that resepective log statement starting from the date is required.
example:
2014/10/01 16:14:44.459|>=|E|X|19202496|2832|... (5 Replies)
Discussion started by: shravee
5 Replies
10. Shell Programming and Scripting
Dear All
During one of mine script developemnt i am stuch at one sub part. Requiremnt is as below kindly help me.
IP file:
2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001X (unavailable)
2015-02-28 10:10:15 AL M UtranCell UtranCell=RTE001Y (unavailable)
2015-02-28 10:10:15 AL M... (6 Replies)
Discussion started by: jaydeep_sadaria
6 Replies
LEARN ABOUT DEBIAN
class::makemethods::utility::textbuilder
MakeMethods::Utility::TextBuilder(3pm) User Contributed Perl Documentation MakeMethods::Utility::TextBuilder(3pm)
NAME
Class::MakeMethods::Utility::TextBuilder - Basic text substitutions
SYNOPSIS
print text_builder( $base_text, @exprs )
DESCRIPTION
This module provides a single function, which implements a simple "text macro" mechanism for assembling templated text strings.
$expanded_text = text_builder( $base_text, @exprs )
Returns a modified copy of $base_text using rules from the @exprs list.
The @exprs list may contain any of the following:
o A string, in which any '*' characters will be replaced by the base text. The interpolated string then replaces the base text.
o A code-ref, which will be called with the base text as its only argument. The result of that call then replaces the base text.
o A hash-ref, which will be added to the substitution hash used in the second pass, below.
o An array-ref, containing additional expressions to be treated as above.
After any initial string and code-ref rules have been applied, the hash of substitution rules are applied.
The text will be searched for occurances of the keys of the substitution hash, which will be modified based on the corresponding value in
the hash. If the substitution key ends with '{}', the search will also match a balanced block of braces, and that value will also be used
in the substitution.
The hash-ref may contain the following types of rules:
o 'string' => 'string'
Occurances of the first string are to be replaced by the second.
o 'string' => code_ref
Occurances of the string are to be replaced by the results of calling the subroutine with no arguments.
o 'string{}' => 'string'
Occurances of the first string and subsequent block of braces are replaced by a copy of the second string in which any '*' characters
have first been replaced by the contents of the brace block.
o 'string{}' => code_ref
Occurances of the string and subsequent block of braces are replaced by the results of calling the subroutine with the contents of the
brace block as its only argument.
o 'string{}' => hash_ref
Occurances of the string and subsequent block of braces are replaced by using the contents of the brace block as a key into the
provided hash-ref.
EXAMPLE
The following text and modification rules provides a skeleton for a collection letter:
my $letter = "You owe us AMOUNT. Please pay up!
" .
"THREAT{SEVERITY}";
my @exprs = (
"Dear NAMEm
*",
"*
-- The Management",
{ 'THREAT{}' => { 'good'=>'Please?', 'bad'=>'Or else!' } },
" DATE
*",
{ 'DATE' => 'Tuesday, April 1, 2001' },
);
One might invoke this template by providing additional data for a given instance and calling the text_builder function:
my $item = { 'NAME'=>'John', 'AMOUNT'=>'200 camels', 'SEVERITY'=>'bad' };
print text_builder( $letter, @exprs, $item );
The resulting output is shown below:
Tuesday, April 1, 2001
Dear John,
You owe us 200 camels. Please pay up!
Or else!
-- The Management
SEE ALSO
See Class::MakeMethods for general information about this distribution.
perl v5.10.1 2004-09-06 MakeMethods::Utility::TextBuilder(3pm)