bounty457
asked on
How can i sort a List to get the newest .mp3 Files
Hello,
i'am using in C# a List to save the filenames from one directory.
The Last 17 numbers are the timestamp.
This is the content of myList:
241_3_Rock__20141015210003 828.mp3
241_3_Rock__20141016210001 752.mp3
241_3_Rock__20141017210001 782.mp3
241_3_Rock__20141018210001 368.mp3
330_1___20141015210007187. mp3
330_1___20141016210003971. mp3
330_1___20141017210002719. mp3
330_1___20141018210001884. mp3
400_1___20141015210007187. mp3
400_1___20141016210003971. mp3
400_1___20141017210002719. mp3
400_1___20141018210001884. mp3
330_1__600207_201410170841 27436.mp3
400_1__500107_201410170841 27436.mp3
I need the newest Files with beginning:
241_3_Rock
330_
400_
this should be the result:
241_3_Rock__20141018210001 368.mp3
330_1___20141018210001884. mp3
400_1___20141018210001884. mp3
this should be ignored:
330_1__******
400_1__******
result ignored:
330_1__600207_201410170841 27436.mp3
400_1__500107_201410170841 27436.mp3
Do you have any ideas for this?
Very welcome with source Example.
Thank you very much in advance,
Kind regards
Bounty
i'am using in C# a List to save the filenames from one directory.
The Last 17 numbers are the timestamp.
This is the content of myList:
241_3_Rock__20141015210003
241_3_Rock__20141016210001
241_3_Rock__20141017210001
241_3_Rock__20141018210001
330_1___20141015210007187.
330_1___20141016210003971.
330_1___20141017210002719.
330_1___20141018210001884.
400_1___20141015210007187.
400_1___20141016210003971.
400_1___20141017210002719.
400_1___20141018210001884.
330_1__600207_201410170841
400_1__500107_201410170841
I need the newest Files with beginning:
241_3_Rock
330_
400_
this should be the result:
241_3_Rock__20141018210001
330_1___20141018210001884.
400_1___20141018210001884.
this should be ignored:
330_1__******
400_1__******
result ignored:
330_1__600207_201410170841
400_1__500107_201410170841
Do you have any ideas for this?
Very welcome with source Example.
Thank you very much in advance,
Kind regards
Bounty
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much,
it works fine.
Kind regrads
it works fine.
Kind regrads
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for bounty457's comment #a40494527
for the following reason:
Very Good
Accepted answer: 0 points for bounty457's comment #a40494527
for the following reason:
Very Good
Hi Bounty457.
You seem to have accepted your own answer as the answer, when I think you should have been accepting another expert's answer. You haven't responded to either Expert's answer but your last comment indicates that it works.
I've objected to your closing of the question so that you can assign points accordingly.
Thanks
Chris
You seem to have accepted your own answer as the answer, when I think you should have been accepting another expert's answer. You haven't responded to either Expert's answer but your last comment indicates that it works.
I've objected to your closing of the question so that you can assign points accordingly.
Thanks
Chris
We need some more information. For example how do you determine which files are ignored in the list?
In your question you state that, "this should be the result:"
241_3_Rock__20141018210001
330_1___20141018210001884.
400_1___20141018210001884.
But from what I can tell this is the sort order by date;
330_1___20141018210001884.
400_1___20141018210001884.
241_3_Rock__20141018210001
Can you please explain. Thank you