2 Dimensional Array Sorting

Vino.B via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 26 03:45:13 PDT 2017


On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote:
> On Saturday, 26 August 2017 at 09:53:44 UTC, Vino.B wrote:
>> On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote:
>>> [...]
>>
>> Hi,
>>   I tired you logic, but doesn't seem to be working, as every 
>> time i execute the order of the file list is different as in 
>> the below program i have used the sort based on the file name.
>>
>> [...]
>
> Try with (a,b) => a[1].to!int < b[1].to!int as predicate. T

Hi,

  Now there is no duplicate , but the sequence is still not correct

Output: the File C:\Temp\TEAM2\PROD_TEAM\dir1 is after 
C:\Temp\TEAM3\EXPORT\dir2
C:\Users\admin\Desktop\Script\D>rdmd Ftest.d
C:\Temp\TEAM2\BACKUP\dir1                                     
35732
C:\Temp\TEAM2\TEAM\DIR1                                       40
C:\Temp\TEAM2\TEAM\DIR2                                       2228
C:\Temp\TEAM2\EXPORT\dir2                                     30
C:\Temp\TEAM3\BACKUP\dir1                                     
71465
C:\Temp\TEAM3\EXPORT\dir2                                     61
C:\Temp\TEAM2\PROD_TEAM\dir1                                  
35772

Required output
C:\Temp\TEAM2\BACKUP\dir1                                     
35732
C:\Temp\TEAM2\TEAM\DIR1                                       40
C:\Temp\TEAM2\TEAM\DIR2                                       2228
C:\Temp\TEAM2\EXPORT\dir2                                     30
C:\Temp\TEAM2\PROD_TEAM\dir1                                  
35772
C:\Temp\TEAM3\BACKUP\dir1                                     
71465
C:\Temp\TEAM3\EXPORT\dir2                                     61

From,
Vino.B


More information about the Digitalmars-d-learn mailing list