I have two files. A 'sequence' file, which looks like this.
>ONE IRLA >TWO REFT >THREE HTED
and a set of correponding 'co-ordinate' files. The name of the co-ordinate file that corresponds to a particular sequence in the sequence file is highlighted by '>' a line above the actual sequence. Each of these files is made up of entries. Each entry is numbered. Some co-ordinate files start with entry number 1 but not all. The one below (the co-ordinate file named 'ONE'), for example, starts with an entry numbered 12.
12 14.620 35.834 -16.759 1.00 11.04 13 15.922 36.983 -19.044 1.00 11.22 14 14.326 37.148 -21.240 1.00 11.40 15 11.528 38.248 -23.343 1.00 12.44
This corresponds to the first sequence in the sequence file
IRLA
I need to assign each letter in that sequence with the corresponding entry in the corresponding co-ordinate file. You read the sequence file from left to right with each letter needing to be mapped to an numbered entry in the co-ordinate file. So .. for the first letter 'R' in the sequence, it has to be mapped to entry number 13 in the co-ordinate file - the second letter in the sequence 'R', it corresponds to the second entry in the co-ordinate file, which in this case is entry 13. The resulting text file should look like this
I 12 R 13 L 14 A 15
I'm not sure what the best way of going about writing a perl script for this is. Any advice/hints much appreciated. The real examples are obviously far larger than the test case presented here

In reply to mapping data between files by Angharad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.