in reply to Re: Collapsing a list of files...
in thread Collapsing a list of files...
Here's the deal. Each of the files in that original list of 5,000 will have a prefix of 3 characters, a middle pattern of [\w+\d]*[l|n]n, and a suffix of n digits. Now that I think about it, you can ignore the suffix altogether and just replace the n digits with *. So all we need to focus on is the prefix and middle pattern. Now I need to do this:-
1. Fracture up the start list into n new lists, where n is the number of unique prefixes. So if n = 3, the sum total of the file names in the 3 lists will equal 5,000.
2. Now take each list from #1 and reduce each one down to the fewest number of unique patterns that end in *. The prefix must be preserved, as well as, at a minimum, the first character of the middle string.
3. There can only be one *, and it has to be at the end of each pattern. The original example should make this clear. (Again, it closely resembles the actual file names and the outcome I want.)
Hopefully this helps!
Thanks,
fiddler42
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Collapsing a list of files...
by Anonymous Monk on Sep 17, 2009 at 00:35 UTC | |
|
Re^3: Collapsing a list of files...
by graff (Chancellor) on Sep 17, 2009 at 03:53 UTC | |
|
Re^3: Collapsing a list of files...
by kennethk (Abbot) on Sep 17, 2009 at 15:07 UTC |