in reply to data formatting in excel


I'm going to guess that what you want to do is to "match data in column 2 of a file if the current or previous non-blank entry in column 1 matches another condition". I'd also guess that Excel doesn't have anything to do with the problem.

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.

Replies are listed 'Best First'.
Re^2: data formatting in excel
by pingme8705 (Acolyte) on Oct 04, 2005 at 08:48 UTC
    hi
    open excel sheet store first column i- command in a array store the results in the 2nd array For the first command in the first column - check for the output in th +e second column + the pattern to be observed if the pattern matched then open another excel sheet and fill in the f +irst col by command name and second column by pattern we found check for the second command and so on… once end of first sheet open second sheet and so on…
    i think this may help you to understand the problem
    pingme8705 The world belong to the people who beleive in the beauty of their drea +ms