I'm guessing this because, despite being given the opportunity to do so, you haven't explained clearly what you want to do.
Here is an example program based on the above assumptions:
#!/usr/bin/perl -w use strict; my $pattern1 = qr/encryption/; my $pattern2 = qr/encryption/; my $in_match = 0; while (<DATA>) { next unless /\S/; # Skip blank lines chomp; my ($command, $output) = split /\|/; if ($command =~ /\S/) { $in_match = $command =~ $pattern1; } if ($in_match and $output =~ $pattern2) { print $_, "\n"; } } __DATA__ Command | output show run in encryption | service password-encryption | fsddfsfsdfsdfsd sdfs sd | encryption | foo show ntp status | clock synchronised. 34.45.54.54 | some other text encryption1 | encryption2
If this program isn't something like what you are looking for then you are really going to have to show a clear example in code or pseudo-code of what you are trying to do, with clear input and expected output.
--
John.
In reply to Re: data formatting in excel
by jmcnamara
in thread data formatting in excel
by pingme8705
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |