Hello,
I have a directory that holds all of my matlab codes. I am trying to run a searh on all of the matlab files that have the word "while" written inside the sytax of the code.
Looking for all of the times that I did a while loop.
Can someone help me do this?
Thanks in advance.
... (1 Reply)
Hi,
I am writing a shell (after 6-7 months)that has to receive text from another shell, check if the first line in the text has a key word and then execute different shell.I could come up with the below program structure, please suggest me if there is a better way to do it or please help me with... (14 Replies)
Hello:
I need help adding a key word search to my bash script. I have the following script. My boss whats the user to be able to add a search word e.g. unknown failures for the script to search the logs through and find the instances. I had originally done it so it grepped for unknown... (8 Replies)
cat shell_script.ksh
x=$A
y=$B
export x
export y
echo $x
echo $y
when i am running this with a command
ksh shell_script.ksh -A 10 -B 20
its not showing anything ....
could you let me know how i can use key word type paramter (2 Replies)
Hi,
Now i work in a code that
1-get data stored in the database in the form of hash table with a key
field which is the " Name"
2-in the same time i open a txt file and loop through it word by word
3- which i have a problem in is that :
I need to loop word by word and check if it is a... (0 Replies)
i have a file containing over 1 million records,and i want to print about 300,000 line containing a some specific words.
file has content.
eg
1,rrt,234
3,fgt,678
4,crf,456
5,cde,drt
6,cfg,123
and i want to print the line with the word fgt,crf
this is just an example,my file is so... (2 Replies)
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
I am new to shell scripting and trying to do the below
Stan:Smith:Detroit:MI
Jim:Jones:Farmington Hills:MI
Jack:Frost:Denver:CO
Sue:Apple:New York:NY
Cindy:Thompson:Battle Creek:MI
John:Smith:Denver:CO
George:Jones:New York:NY
Need to create a shell script This script will display the... (1 Reply)
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
LEARN ABOUT DEBIAN
xml::grove::subst
XML::Grove::Subst(3pm) User Contributed Perl Documentation XML::Grove::Subst(3pm)NAME
XML::Grove::Subst - substitute values into a template
SYNOPSIS
use XML::Grove::Subst;
# Using subst method on XML::Grove::Document or XML::Grove::Element:
$new_grove = $source_grove->subst( ARGS );
$new_grove = $source_grove->subst_hash( ARG );
# Using an XML::Grove::Subst instance:
$subster = XML::Grove::Subst->new();
$new_grove = $subster->subst( $source_grove, ARGS );
$new_grove = $subster->subst_hash( $source_grove, ARG );
DESCRIPTION
"XML::Grove::Subst" implements XML templates. "XML::Grove::Subst" traverses through a source grove replacing all elements with names
`"SUB:XXX"' or `"SUB:key"' with their corresponding values from ARGS (a list) or ARG (a hash), repsectively.
METHODS
$grove_obj->subst( ARGS ) =item $subster->subst( $grove_obj, ARGS )
Search for `"SUB:XXX"' elements, where XXX is an array index, and replace the element with the value from ARGS, a list of values. The
return value is a new grove with the substitutions applied.
$grove_obj->subst_hash( ARG ) =item $subster->subst_hash( $grove_obj, ARG )
Search for `"SUB:key"' elements and replace the element with the value from ARG, a hash of values. The hash key is taken from the
`"key"' attribute of the `"SUB:key"' element, for example, `"<SUB:key key='foo'>"'. The return value is a new grove with the
substitutions applied.
EXAMPLE
The following template, in a file `"template.xml"', could be used for a simple parts database conversion to HTML:
<html>
<head>
<title><SUB:key key='Name'></title>
</head>
<body>
<h1><SUB:key key='Name'></title>
<p>Information for part number <SUB:key key='Number'>:</p>
<SUB:key key='Description'>
</body>
</html>
To use this template you would first parse it and convert it to a grove, and then use `"subst_hash()"' every time you needed a new page:
use XML::Parser::PerlSAX;
use XML::Grove;
use XML::Grove::Builder;
use XML::Grove::Subst;
use XML::Grove::PerlSAX;
use XML::Handler::XMLWriter;
# Load the template
$b = XML::Grove::Builder->new();
$p = XML::Parser::PerlSAX->new( Handler = $b );
$source_grove = $p->parse( Source => { SystemId => 'template.xml' } );
# Apply the substitutions
$new_grove = $source_grove->subst_hash( { Name => 'Acme DCX-2000 Filter',
Number => 'N4728',
Description => 'The Best' } );
# Write the new grove to standard output
$w = XML::Handler::XMLWriter->new();
$wp = XML::Grove::PerlSAX->new( Handler => $w );
$wp->parse( Source => { Grove => $new_grove } );
AUTHOR
Ken MacLeod, ken@bitsko.slc.ut.us
SEE ALSO perl(1), XML::Grove(3)
Extensible Markup Language (XML) <http://www.w3c.org/XML>
perl v5.10.1 2010-01-29 XML::Grove::Subst(3pm)