in reply to Re^3: Running complex sed from perl
in thread Running complex sed from perl

I attempted this and I get a double quote in front of each line, that was one of the issues I was having with the perl componet, which was I returned to awk. Do you have any idea why only the beginning lines get two double quotes? The same thing occurs when I attempted to make a one liner out of the sed call for the double quotes.

Replies are listed 'Best First'.
Re^5: Running complex sed from perl
by aaron_baugher (Curate) on Dec 02, 2013 at 23:51 UTC

    Your lines probably end with newlines (carriage returns), so your end quote ends up at the beginning of the next line. To avoid that, chomp the line, add your quotes, then print it with a newline:

    chomp $line; $line = qq|"$line"|; print "$line\n";

    Aaron B.
    Available for small or large Perl jobs and *nix system administration; see my home node.