Unix/Linux Go Back    

Make Multile line is one line using window Perl

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member adisky123 Regarding:
Make Multile line is one line using window Perl.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 12-31-2012   -   Original Discussion by adisky123
adisky123's Unix or Linux Image
adisky123 adisky123 is offline
Registered User
Join Date: Oct 2012
Last Activity: 23 December 2013, 5:57 AM EST
Posts: 58
Thanks: 5
Thanked 0 Times in 0 Posts
Finally this thread ends up with this working code

my $new='';

open('NEW',"<$new_file") || die "Error open file $new_file\n";
open('NEW1',">$flat_file") || die "Error open file $flat_file\n";

  while (my $s2=<NEW>) {
      if($s2 =~ /ESP Client/){
        print NEW1 "$new\n"; $new='';
          $new = $new.$s2;