in reply to Re^4: duplicating the rows and joining three lines into one using perl script
in thread duplicating the rows and joining three lines into one using perl script

I was taking for granted, based on the OP examples, that the input would always be one RS line followed by one RAd line followed by one ore more RC lines. If that's true, then "$line_out" always starts fresh on each RS line, and accumulates content until the first RC line, at which point the current RC line is only appended in the print statement, and not permanently appended to $line_out.
  • Comment on Re^5: duplicating the rows and joining three lines into one using perl script

Replies are listed 'Best First'.
Re^6: duplicating the rows and joining three lines into one using perl script
by Laurent_R (Canon) on Oct 08, 2015 at 07:40 UTC
    Yes, and that's also how I understood it. My only point was only about adding a comma to separate the line fragments, but I had overlooked that you're actually adding the comma it in the:
    s/\s+$/,/;
    code lines.

    Sorry about the useless comment.