in reply to Text file manupulation to create test files

I'm having trouble understanding your intent... for several reasons, including

Is the "n" in line n a variable number? Are lines 2- ..n really empty? Do they actually contain headers such as "line 1-", "line 2-"...? If they exist, are the trailing hyphens inconsistent as in what you posted?

Please clarify.

For a shot-in-the-dark, if the "Loop n" header consistently follows an empty "line n", then you have data which is probably susceptible to attack with a regex. And if the line-numbered data is more-or-less the way it looks here, then spliting on commas and combining (concatenating) the first three elements or a regex with captures nto AoAs might be a useful step one.

Replies are listed 'Best First'.
Re^2: Text file manupulation to create test files
by elef (Friar) on Jan 10, 2011 at 18:01 UTC
    And if the line-numbered data is more-or-less the way it looks here, then spliting on commas and combining (concatenating) the first three elements or a regex with captures nto AoAs might be a useful step one.

    If the actual data looks like this excerpt, I would just do
    s/,\s*WMDS/\nWMDS/;

    Of course it's impossible to tell without knowing the data if comma-whitespace-WMDS in fact a good separator string to use.