use strict; use warnings; my $sc = 1; while () { my (undef,$repeat,$seq) = split /\s+/,$_; my $i = 1; while ($repeat--) { printf "%d-%d %s\n",$sc,$i++,$seq; } $sc += 1; } __DATA__ 1 2 tt 2 3 aa 3 1 dd