Hi all,
I want to write a shell which would allow me to edit a text file or a xml file.
Basically i want to add a new node in a existing xml file. The values for this new node are based on user input.
Thanks in advance
Zing (9 Replies)
Hi,
i am using SuonOS and ksh.
i need to add data into a file(s.txt) using a shell script. i have to pass 3 parameters and these 3 paramaters should add into the file at end of the file.
File s.txt is look like,
---------------------------------
column1|column2|column3
... (1 Reply)
Dear Friends,
I am beginner in Perl and trying to find the problem in a script. Kindly help me to modify the script. My script is not giving the output for the last field and followed text (LA: Language English). Input file & script as follows:
Input file:
Thu Mar 19 2:34:14 EDT 2009
STC... (3 Replies)
Hi everyone,
the problem is quite simple, yet I can't find an easy solution using awk.
I need to search for a string in $3, then if I find this string, copy the line,modify $3, and copy the next 9 lines to the same file.
My problem is in the copying of the lines... Finding and modifying... (5 Replies)
I need to read data from a file called "test.csv" through shell script where the file contains values like name,price,descriptor etc. There are rows where descriptor (& in some rows name) are written as string & other characters like "car_+" OR "bike*" etc where it should contains strings like... (3 Replies)
Hi,
I want a script shell to automate modifying httpd.conf file for
several instances of apache, save httpd.file before changing it, after
modifying it and then restart apache.
- Replace ServerRoot "xxxx" by ServerRoot "yyyy" of all directories :
"... (4 Replies)
Hi All the Helpers!
I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt
input.txt
VOP 111 0 1 2
DEM 111 0 222 333 444 555
879 888 987 888 989
VOP 118 0... (2 Replies)
I have text file with lines as shown here. Each row has 11 columns separated by tab. In each row, i want to split the 8th column such that the output should look like shown below. Here value in the 9th column is DP value and in the 10th column is MQ value followed by the values after resource.EFF=.... (15 Replies)
Hello all,
I have some text files I need to do the following on:
Delete banner page (lines 1-56) --I am doing this using sed
Remove ^M --I am doing this using vi
Remove trailer page --this can vary based on the contents of the file, it usually starts with ***************************
I am... (5 Replies)
Discussion started by: jeffs42885
5 Replies
LEARN ABOUT MOJAVE
mime::field::paramval5.18
MIME::Field::ParamVal(3) User Contributed Perl Documentation MIME::Field::ParamVal(3)NAME
MIME::Field::ParamVal - subclass of Mail::Field, for structured MIME fields
SYNOPSIS
# Create an object for a content-type field:
$field = new Mail::Field 'Content-type';
# Set some attributes:
$field->param('_' => 'text/html');
$field->param('charset' => 'us-ascii');
$field->param('boundary' => '---ABC---');
# Same:
$field->set('_' => 'text/html',
'charset' => 'us-ascii',
'boundary' => '---ABC---');
# Get an attribute, or undefined if not present:
print "no id!" if defined($field->param('id'));
# Same, but use empty string for missing values:
print "no id!" if ($field->paramstr('id') eq '');
# Output as string:
print $field->stringify, "
";
DESCRIPTION
This is an abstract superclass of most MIME fields. It handles fields with a general syntax like this:
Content-Type: Message/Partial;
number=2; total=3;
id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
Comments are supported between items, like this:
Content-Type: Message/Partial; (a comment)
number=2 (another comment) ; (yet another comment) total=3;
id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
PUBLIC INTERFACE
set [\%PARAMHASH | KEY=>VAL,...,KEY=>VAL]
Instance method. Set this field. The paramhash should contain parameter names in all lowercase, with the special "_" parameter name
signifying the "default" (unnamed) parameter for the field:
# Set up to be...
#
# Content-type: Message/Partial; number=2; total=3; id="ocj=pbe0M2"
#
$conttype->set('_' => 'Message/Partial',
'number' => 2,
'total' => 3,
'id' => "ocj=pbe0M2");
Note that a single argument is taken to be a reference to a paramhash, while multiple args are taken to be the elements of the
paramhash themselves.
Supplying undef for a hashref, or an empty set of values, effectively clears the object.
The self object is returned.
parse_params STRING
Class/instance utility method. Extract parameter info from a structured field, and return it as a hash reference. For example, here
is a field with parameters:
Content-Type: Message/Partial;
number=2; total=3;
id="oc=jpbe0M2Yt4s@thumper.bellcore.com"
Here is how you'd extract them:
$params = $class->parse_params('content-type');
if ($$params{'_'} eq 'message/partial') {
$number = $$params{'number'};
$total = $$params{'total'};
$id = $$params{'id'};
}
Like field names, parameter names are coerced to lowercase. The special '_' parameter means the default parameter for the field.
NOTE: This has been provided as a public method to support backwards compatibility, but you probably shouldn't use it.
parse STRING
Class/instance method. Parse the string into the instance. Any previous information is wiped. The self object is returned.
May also be used as a constructor.
param PARAMNAME,[VALUE]
Instance method. Return the given parameter, or undef if it isn't there. With argument, set the parameter to that VALUE. The
PARAMNAME is case-insensitive. A "_" refers to the "default" parameter.
paramstr PARAMNAME,[VALUE]
Instance method. Like param(): return the given parameter, or empty if it isn't there. With argument, set the parameter to that
VALUE. The PARAMNAME is case-insensitive. A "_" refers to the "default" parameter.
stringify
Instance method. Convert the field to a string, and return it.
tag Instance method, abstract. Return the tag for this field.
SEE ALSO
Mail::Field
perl v5.18.2 2013-11-14 MIME::Field::ParamVal(3)