Thank you 1nickt I implemented your idea, slightly modified based on my situation, so it looks like this:
if ( $RESULT eq "" ) { print DEBUG1 "Line is \"" . $line ."\"\n"; my $action = substr($ACTION, 0, 1); open OUT4, ">>", $csvtogo or die "Could not op +en OUT4: $!\n"; if ( $line =~ /parameters\ after\ change/ ) { #Start of block to manage $inblock = 1; next; } # Skip handling line unless we are in a block next unless ( $inblock ); if ( $line =~ /NRG\ location/) { print OUT4 "$timestamp;$action;"; # Block ends here # Process all blocked lines stored in +@blocklines my ($k, $v); my @fields; my %lookup = map { $_ => 1 } @csvfield +list; foreach my $bline (@blocklines) { print DEBUG1 "bline: \"$bline\ +"\n"; my ($k, $v) = split '=', $blin +e; push @fields, $k; } print DEBUG Dumper (\@fields); for my $element ( @fields ) { if (exists $lookup{$element}) +{ print OUT4 "yes;"; } else { print OUT4 ";"; } } print OUT4 "\n" #Cleanup block now that it has been pr +ocessed @blocklines = (); $inblock = 0; next; } # Just a line we want to process within the bl +ock # Push it into @blocklines so we can process i +t push @blocklines, $line; next; }
When I look at my results file (OUT4), I see this (in part):
2018_11_20-11_15_58;C;;yes;;;; 2018_11_20-11_15_58;C;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes; +yes;yes;yes;yes;yes;yes;;;;;yes;yes;yes;yes;yes;yes;yes;;;;;;;;;;; 2018_11_20-11_15_58;C;;; 2018_11_20-11_15_58;C;yes;yes;yes;yes;; 2018_11_20-11_15_58;C;yes;yes; 2018_11_20-11_15_58;C;yes;yes; 2018_11_20-11_15_58;C;yes;yes; 2018_11_20-11_15_58;C;yes;;;; 2018_11_20-11_15_58;C;yes;;;;; 2018_11_20-11_15_58;C;yes; 2018_11_20-11_15_58;C;yes;yes;yes;; 2018_11_20-11_44_51;C;;yes;;;; 2018_11_20-11_44_51;C;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes;yes; +yes;yes;yes;yes;yes;yes;;;;;yes;yes;yes;yes;yes;yes;yes;;;;;;;;;;;
Each line above should be MUCH longer. When I print @fields to DEBUG, I get this (in part):
$VAR1 = [ 'algorithmPosition', 'authenticationSubscriberType', 'k4id', 'OP_id', 'authKey' ]; $VAR1 = [ 'mobileNetworkCodeId', 'mobileCountryCodeId', 'chargingGatewayFuncHost', 'chargingGroup', 'S6aRoamingRestrictionType', 'pcscfServerName', 'maxRequestedBandwidthUL', 'maxRequestedBandwidthDL', 'epsAccessSubscriptionType', 'epsAccessSubscriptionType', 'odbSpecificToPs', 'psRoamingRestrictionType', 'chargingCharacteristics', 'odbCustoPremRateCalls', 'odbOutgoingCalls', 'accessRestrictionData', 'networkAccessMode', 'mSubIdentificationNumberId', 'GcsServiceProfile', 'OdbServiceProfile', 'MainSNwithBearerService', 'MainSNwithBearerService', 'cwTSSpeechActivationFlag', 'callWaitingProvisionedFlag', 'clipProvisionedFlag', 'mptyProvisionedFlag', 'callHoldProvisionedFlag', 'clirProvisionedFlag', 'csRoamingRestrictionType', 'eps3gppRestrictionListNum', 'psRestrictionListNum', 'csRestrictionListNum', 'packetMsAddressList', 'packetMsAddressList', 'framedPoolSetList', 'framedPoolSetList', 'epsApnContextSetList', 'epsApnContextSetList', 'epsServiceProfile' ]; $VAR1 = [ 'serverCapIdx', 'chargingIdx' ]; $VAR1 = [ 'authEntryType', 'hlrIndicator', 'protocolCap', 'authSchema', 'imsi' ]; $VAR1 = [ 'puidType', 'unregSvcInd' ]; $VAR1 = [ 'puidType', 'unregSvcInd' ]; $VAR1 = [ 'puidType', 'unregSvcInd' ];
Do I need to include the whole 900+ item array as well? Or can you see what's going on based on what you see here? Thanks again!

In reply to Re^2: Determine if array value in string results by ImJustAFriend
in thread Determine if array value in string results by ImJustAFriend

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.