I am fairly new to Perl. I have a file with data in it which looks like this:
> <Study Design|2|Additional Findings|1|Timepoint>
15

> <Study Design|2|Additional Findings|1|Timepoint Unit>
Days

> <Study Design|2|Additional Findings|1|Dose (Mg/Kg)>
20

> <Study Design|2|Additional Findings|1|Average Value>
412.22

> <Study Design|2|Additional Findings|1|Sd>
61.05

> <Study Design|2|Additional Findings|2|Timepoint>
15

> <Study Design|2|Additional Findings|2|Timepoint Unit>
Days

> <Study Design|2|Additional Findings|2|Dose (Mg/Kg)>
20

> <Study Design|2|Additional Findings|2|Average Value>
71.74

> <Study Design|2|Additional Findings|2|Sd>
11.07

And I want to end up with a tab separated column output:
Timepoint Timepoint Unit Dose Average Value SD
15 Days 20 412.22 61.05
I have worked out how to write a very basic Perl script which opens the file, reads it, and prints out the pairs of lines, but I'm not sure where to go from here. Can someone point me in the right direction - I'm really new to Perl and scripting altogether.
Thank you

In reply to Parsing multiple rows of text and converting to columns by gingeremmie

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.