Return to Snippet

Revision: 58360
at July 11, 2012 03:56 by page_lab


Initial Code
#caso 1
#================


#!/usr/bin/perl -w
$ii = 0; 
while(<>) {
	my $increment = $_;
	$increment =~ s/(href=\"\#n|\">|id=\"n)\d/$1.$ii++/e;
	print $increment;
}

#caso 2
#================



#!/usr/bin/perl -w
$ii = 0; 
while(<>) {
	my $increment = $_;
	$increment =~ s/(<a class=\"note\" epub:type=\"noteref\" href=\"\#n\d+\">)\d/$1.$ii++/e;
	print $increment;
}

#caso 3
#================


#!/usr/bin/perl -w
$ii = 0; 
while(<>) {
	my $increment = $_;
	$increment =~ s/( id=\"n)\d/$1.$ii++/e;
	print $increment;
}

Initial URL

                                

Initial Description

                                

Initial Title
Replace number sequentially with grep

Initial Tags
perl

Initial Language
Perl