<?xml version="1.0" encoding="windows-1252"?>
<node id="795721" title="Collapsing a list of files..." created="2009-09-16 18:18:20" updated="2009-09-16 18:18:20">
<type id="115">
perlquestion</type>
<author id="257946">
fiddler42</author>
<data>
<field name="doctext">
Kind Folk,&lt;p&gt;
&lt;p&gt;
I have a list of c. 5,000 files that I need to collapse into the smallest possible list of files with wildcards.  For example, say I have some files named:-&lt;p&gt;
&lt;code&gt;
abcpwbln08
abcpwbln07
abcpwbnn10
abcpwbnn06
adesicln09
adesicln08
adesicln01
adesicnn05
&lt;/code&gt;
...and I need to reduce them to:-&lt;p&gt;
&lt;code&gt;
abcpwbln0*
abcpwbnn*
adesicln0*
adesicnn05
&lt;/code&gt;
Any suggestions on how to do this as efficiently as possible in perl?  The routine will start off by just reading in the contents of a user-specified unix directory.  The names will be very similar to what's referenced above.&lt;p&gt;
&lt;p&gt;
Thanks,&lt;p&gt;
-fiddler42</field>
</data>
</node>
