in reply to Writing data into columns

To expand a bit on that last point raised by toolic above: I have reason to suspect that your "Desired output" might contain some typos (missing numbers, bad spacing, etc). But it would be unwise for me to guess at what the correct form should be, because I have no way of knowing that. I'm just reacting to some apparent discrepancies in your "data" that aren't explained in your "description".

Also, when you say "... the numbers ... could have letters in them ... the numbers/entryes ... could have letters and hyphens in them ...", it really is impossible for us to make any sense of this, unless you actually show some relevant examples of actual input and (correct) desired output.

Apart from that, you will need to show some perl code that you have tried.