in reply to searching for strings
#!/usr/bin/perl use strict; sub simstr { $_ = shift; if (/([a-z])$/i) { my $ch = $1; $ch++; $ch =~ s/.*(.)$/$1/; substr ($_, -1) = $ch; } elsif (/\d+$/) { $_++; } $_; } for (<DATA>) { chomp; print "$_;" . simstr ($_) . "\n"; } __DATA__ AAA30 BBC5 SHT12H DAL33B BBC49 AAA31 DAL33A BBC6 SHT12G BBC50
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: searching for strings
by Philem (Acolyte) on Aug 06, 2007 at 14:43 UTC | |
by Zielony (Acolyte) on Aug 06, 2007 at 16:00 UTC |