my $seen=0; while(<DATA>) { if ($seen) { s{<cnt>Germany</cnt>}{<TAB>} } else { $seen ||= m{<cnt>Germany</cnt>} } print; } __DATA__ <cnt>Germany</cnt><cmp>ALLIANZ INSURANCE</cmp> <cnt>Germany</cnt><cmp>ALLIANZ PARKWAY</cmp> <cnt>Germany</cnt><cmp>ALLIED DOMECQ</cmp>
In reply to Re^3: replace all but first
by Roy Johnson
in thread replace all but first
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |