while () { # the regex remembers for one or more # alphanumeric characters \w+ # followed by an equal sign and double quote # then remembers one or more digit or comma [\d\,]+ # follwed by a double quote. if (/(\w+)\=\"([\d\,]+)\"/) { # The print statement adds an equal amount # of padding between the first entry and the # second by subtracting the length of $1 by # twenty and then adding that many spaces # to the output. # replace ', " " x (20 - length $1)' # with ', "\t"' if you want a tab instead print ucfirst($1) , " " x (20 - length $1) , $2 , "\n"; } } __DATA__ FEATURE /group=" " /translation="MMSKLGVLLT ICLLLFPLTA VQLDGDQPAD LPALRTQDIA TDHSPWFDPV KRCCSRYCYI CIPCCPN" /disulfide="9,19" /disulfide="13,24" /hydroxylation="10" /hydroxylation="11" /post_trans_mod="