kar_333 has asked for the wisdom of the Perl Monks concerning the following question:
hello monks
I am having problem in parsing the output from the CSV file. I want to add pipe symbol in between the character to do mutliple search similar to egrep
open(my $data, '<', $Config_File) or die "Could not open '$Config_File +' $!\n"; my $reg_exp; my $severity; my @fields=(); while (my $line = <$data>) { chomp $line; if(!$line =~ /^$/) { @fields = split "," , $line; $reg_exp = $fields[0]; $severity = $fields[1]; print $reg_exp; } } #print $fields[0]; #last unless defined $line; close($data) ;
current Output
service entered the stopped stateservice entered the running state
desired output
service entered the stopped state|service entered the running state
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing output from the CSV file
by Tux (Canon) on Feb 07, 2013 at 16:03 UTC | |
Re: Parsing output from the CSV file
by CountZero (Bishop) on Feb 07, 2013 at 19:48 UTC | |
Re: Parsing output from the CSV file
by manorhce (Beadle) on Feb 07, 2013 at 19:51 UTC | |
Re: Parsing output from the CSV file
by GotToBTru (Prior) on Feb 08, 2013 at 22:14 UTC |
Back to
Seekers of Perl Wisdom