How to replace many numbers with one number in a file.
Many numbers like 444565,454678,443298,etc. i want to replace these with one number (300).Please halp me out. (2 Replies)
Hi All ,
Want to know the "sum" of all the digits in below file called "/sample" .Could some one please let me know the script either command .
cat /sample
12
34
23
23
Best Regards,
Chinni . (5 Replies)
Hi,
Can anyone help me to search for multiple strings within specified position and replace with respective string value.
For example I need to search the string from the position 11 to 20 and if it contain ABC and then replace it by BCDEFGHIJ ... find AABZSDJIK and replace with QWE. and... (4 Replies)
Hey guys,
I need to know how to locate all .htaccess files on the server and make a backup of them in the folder they reside before I run a script to modify all of them.
So basically taking dir1/.htaccess and copying it as dir1/.htaccess_bk
dir2/.htaccess copying as dir2/.htaccess_bk... (5 Replies)
How would I do this? How could i use <> symbols for numbers in the find/replace code below?
perl -pi -e 's/test/tst/'
OR is there a better way?
100 5000 2 432 4 2 33 4 5 6 65 300 301
needs to be:
100 300 2 300 4 2 33 4 5 6 65 300 300
also it might not always need spaces... i... (12 Replies)
Hi,
I have a file that consist of around six million line, now the task is to divide this file into 12 small file so that each file would have half a million lines in it.
Thanks. (3 Replies)
I have the input file like this.
Input file: 12.txt
1) There are one or more than one <tr> tags in same line.
2) Some tr tags may have one <td> or more tna one <td> tags within it.
3) Few <td> tags having "<td> </td>". Few having more than one " " entry in it.
<tr> some td... (4 Replies)
Hello,
I am trying to make a awk code that will take 2 files, a txt file like this :
1 1 88 c(1:38, 42, 102)
2 2 128 c(39:41, 43:101, 103:105, 153, 155:189, 292, 344:369)
3 3 84 c(190:249, 603, 606:607, 609:629)
4 4 12 ... (8 Replies)
Template::Declare::TagSet(3pm) User Contributed Perl Documentation Template::Declare::TagSet(3pm)NAME
Template::Declare::TagSet - Base class for tag sets used by Template::Declare::Tags
SYNOPSIS
package My::TagSet;
use base 'Template::Declare::TagSet';
# returns an array ref for the tag names
sub get_tag_list {
[ qw(
html body tr td table
base meta link hr
)]
}
# prevents potential naming conflicts:
sub get_alternate_spelling {
my ($self, $tag) = @_;
return 'row' if $tag eq 'tr';
return 'cell' if $tag eq 'td';
}
# Specifies whether "<tag></tag>" can be
# combined to "<tag />":
sub can_combine_empty_tags {
my ($self, $tag) = @_;
$tag =~ /^ (?: base | meta | link | hr ) $/x;
}
DESCRIPTION
Template::Declare::TagSet is the base class for declaring packages of Template::Delcare tags. If you need to create new tags for use in
your templates, this is the base class for you! Review the source code of Template::Declare::TagSet::HTML for a useful example.
METHODS
new( PARAMS )
my $tag_set = Template::Declare::TagSet->new({
package => 'Foo::Bar',
namespace => undef,
});
Constructor created by "Class::Accessor::Fast", accepting an optional hash reference of parameters.
get_tag_list
my $list = $tag_set->get_tag_list();
Returns an array ref for the tag names offered by a tag set.
get_alternate_spelling( TAG )
$bool = $obj->get_alternate_spelling($tag);
Returns true if a tag has an alternative spelling. Basically it provides a way to work around naming conflicts. For example, the "tr" tag
in HTML conflicts with Perl's "tr" operator, and the "template" tag in XUL conflicts with the "template" sub exported by
"Template::Declare::Tags".
can_combine_empty_tags( TAG )
$bool = $obj->can_combine_empty_tags($tag);
Specifies whether "<tag></tag>" can be combined into a single token, "<tag />". By default, all tags can be combined into a single token;
override in a subclass to change this value where appropriate. For example,
"Template::Declare::TagSet::HTML->can_combine_empty_tags('img')" returns true since "<img src="..." />" is always required for HTML pages.
"Template::Declare::TagSet::HTML->can_combine_empty_tags('script')", on the other hand, returns false, since some browsers can't handle a
single script token.
ACCESSORS
This class has two read-only accessors:
package
my $package = $obj->package();
Retrieves the value of the "package" option set via the constructor.
namespace
my $namespace = $obj->namespace();
Retrieves the value of the "namespace" option set via the constructor.
AUTHOR
Agent Zhang <agentzh@yahoo.cn>.
SEE ALSO
Template::Declare::TagSet::HTML, Template::Declare::TagSet::XUL, Template::Declare::Tags, Template::Declare.
perl v5.10.1 2010-12-08 Template::Declare::TagSet(3pm)