#!/usr/bin/perl -w use strict; my $i = 0; while(){ s/\s//g; if (/^>/) { print "\n" if $i; print ++$i, " : "; next; } chomp; print; } print "\n";