In your SOPW query, you seem open to "some other method?". So, below I will demo another possible technique for you using SQlite + some Perl code. The DB is good at figuring out unique combinations of columns. Below, I did that for 2 columns. Then for each of the combinations, I got the logons associated with them. I did not fiddle with the inherited column. But other than that, this produces the desired output that you listed.

It sounds like you are working a large dataset. Using a DB could be much more flexible than some complex Perl hash of hash code. I wanted to make you aware of this possibility.

use strict; use warnings; use Text::CSV qw(csv); use Data::Dump qw(pp); use DBI; my $aoa = csv (in => \*DATA); # as array of array #pp $aoa; my $dbfile = "testing.sqlite"; my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","",{RaiseError = +> 1}) or die "Couldn't connect to database: " . DBI->errstr; $dbh->do("DROP TABLE IF EXISTS mytable"); $dbh->do ("CREATE TABLE mytable (Server text, Path text, Permissions t +ext, logon text, inheritedFrom text)"); my $insert = $dbh->prepare ("INSERT INTO mytable (Server, Path, Permissions,logon, inher +itedFrom) VALUES (?,?,?,?,?)"); my $get_uniquePathPer = $dbh->prepare ("SELECT Path, Permissions FROM +mytable GROUP BY Path, Permissions"); my $get_logons = $dbh->prepare("SELECT logon FROM mytable WHERE Path=? and Permissions =?"); + # import CSV data into mytable # $dbh->begin_work; shift @$aoa; #throw away header foreach my $csvRef (@$aoa) { $insert->execute((@$csvRef)[0..4]); } $dbh->commit; # Get unique combinations of Path and Permissions # $get_uniquePathPer->execute(); my $aoaPathPer = $get_uniquePathPer->fetchall_arrayref; # For each unique combination get all logons # foreach my $combo_ref (@$aoaPathPer) { print "$combo_ref->[0]\n"; print "$combo_ref->[1]\n"; $get_logons->execute($combo_ref->[0], $combo_ref->[1]); my $aoa_logons = $get_logons->fetchall_arrayref; my @logons = map{@$_}@$aoa_logons; print join (",", @logons),"\n\n"; } =Outputs /Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subscription Rene +wal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Renewal FINAL.pdf FMRWX @FOO NOW Onsite Support,Administrators,Creator Owner,FP NOW BMG FSE NT +FS Admins,ClusterSvcDIR,SYSTEM,MiJim /Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subscription Rene +wal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Renewal FINAL.pdf MRWX @FP DIR BMG /Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subscription Rene +wal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Renewal FINAL.pdf RX &CDAdmin,@FOO DSMS Admins,FOO BMG FS Support,DPeterso,FP BMG IMG Read +Access /Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subscription Rene +wal Docs/My-B8245.pdf FMRWX @FOO NOW Onsite Support,Administrators,Creator Owner =cut __DATA__ File Server,Access Path,Current Permissions,Logon Name,Inherited From +Folders,Flags,User/Group,Classification Results,Classification Result +s by Category (Including Nested),Total Hit Count 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,@FOO NOW Onsite Support,\Common,This folder only, +Pathway12.My.Corp.com\@FOO NOW Onsite Support,IRS Data (1/1),PII (1), +1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,Administrators,\Common,This folder only,10.15.106 +.71\Administrators,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,Creator Owner,\Common,This folder only,Abstract\C +reator Owner,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,FP NOW BMG FSE NTFS Admins,\Common,This folder on +ly,Pathway12.My.Corp.com\FP NOW BMG FSE NTFS Admins,IRS Data (1/1),PI +I (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,ClusterSvcDIR,\Common,This folder only,Pathway12. +My.Corp.com\ClusterSvcDIR,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,SYSTEM,\Common,This folder only,Abstract\SYSTEM,I +RS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,FMRWX,MiJim,<not inherited>,This folder only,"Pathway12 +.My.Corp.com\Michaels, Jim@My",IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,MRWX,@FP DIR BMG,\Common,This folder only,Pathway12.My. +Corp.com\@FP DIR BMG,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,RX,&CDAdmin,\Common,This folder only,Pathway12.My.Corp. +com\&CDAdmin,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,RX,@FOO DSMS Admins,\Common,This folder only,Pathway12. +My.Corp.com\@FOO DSMS Admins,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,RX,FOO BMG FS Support,\Common,This folder only,Pathway1 +2.My.Corp.com\FOO BMG FS Support,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,RX,DPeterso,\Common,This folder only,"Pathway12.My.Corp +.com\Peterson, Dan@My",IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/Axidome Quote My Corp 2020211 KnowBe4 2-yr Rene +wal FINAL.pdf,RX,FP BMG IMG Read Access,\Common,This folder only,Path +way12.My.Corp.com\FP BMG IMG Read Access,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/My-B8245.pdf,FMRWX,@FOO NOW Onsite Support,\Com +mon,This folder only,Pathway12.My.Corp.com\@FOO NOW Onsite Support,IR +S Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/My-B8245.pdf,FMRWX,Administrators,\Common,This +folder only,10.15.106.71\Administrators,IRS Data (1/1),PII (1),1 10.15.106.71,/Common/Awareness and Training/KnowBe4/2020- KnowBe4 Subs +cription Renewal Docs/My-B8245.pdf,FMRWX,Creator Owner,\Common,This f +older only,Abstract\Creator Owner,IRS Data (1/1),PII (1),1

In reply to Re: Building a dynamic array or some other method? by Marshall
in thread Building a dynamic array or some other method? by CAdood

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.