[PLUG] Listing directory by families with same basename
Jason Dubrow
doobie@doobie.org
Sun, 8 Apr 2001 00:15:12 -0500 (EST)
#!/usr/bin/perl
@FILES = `ls`;
foreach $file (@FILES) {
$file =~ s/\..*$//;
$family{$file} = 1;
}
foreach $fam (keys %family) {
print "$fam\n";
}
that should work, but im a bit intoxicated right now...so i'm not 100%
sure
Jason
On Sat, 7 Apr 2001, Lev Gorenstein wrote:
> Pluggers.
>
> I have a question. In my work the commercial molecular modelling
> program works with "families" of files for each molecule. The
> files have common basename and different extensions. So my
> directories look like this:
>
> dimer.dat monomer.dat trimer.dat
> dimer.com monomer.com trimer.com
> dimer.log monomer.log trimer.log
> dimer.m1 monomer.m1 trimer.m1
> dimer.out monomer.out trimer.out
> .....etc (with some non-family files as well).
>
> Well, it's all swell, but when I have more than 5 molecules
> (families) per directory, with at least 5 files per family, all
> this multitude of family files clutters the screen. And for the
> most part I'm more concerned about families as a whole, rather than
> about individual files within a family.
>
> Is there a way to display the content of the directory "by
> family", so that if there are 3 or more files with the same name
> but different extensions, then the output would be shortened?
> That is, for the above case I'd like to see only something like
>
> dimer monomer trimer
>
> Or
> dimer(ALL) monomer(ALL) trimer(ALL)
>
> Or maybe
> dimer (com,dat,log,m1,out)
> monomer (com,dat,log,m1,out)
> trimer (com,dat,log,m1,out)
> test (com,dat)
> aa.c
> foo.bar
> etc.
>
> I'll appreciate any help.
>
>
> Regards,
> Lev
>
> --
> He who laughs, LASTS!
>
>
>
> ____________________________________________________
> The Purdue Linux Users' Group (PLUG) mailing list.
> For account maintenance, go to:
> plug mailing list - plug@csociety.purdue.edu
> http://csociety.ecn.purdue.edu/mailman/listinfo/plug
>