in reply to append line to previous line in txt file

Your "next;" makes it skip the rest of the while loop body. Your if has the same thing in both branches?? How about something like this (in the cb, the requirement to remove the ; was revealed):
my $prev; while (my $line = <>) { chomp $line; print $prev, "\n" if defined $prev && $line !~ s/^;/$prev/; $prev = $line; } print $prev, "\n" if defined $prev;

Replies are listed 'Best First'.
Re^2: append line to previous line in txt file
by mmittiga17 (Scribe) on Jul 09, 2008 at 06:24 UTC
    Awesome that worked... Thanks for your help