Sort order problem in when i read files from output folder path ...

Posted by Divs99 under C# on 6/5/2012 | Points: 10 | Views : 775 | Status : [Member] | Replies : 2
Sort order problem in when i read files from output folder path ...
Directory



.GetFiles(this.OutputFolder)



see below example in output folder i am having filenames in this order

00001-just
00002-sar
00003-emm
00004-kat
00005-sall
54-frank
59-king
63-abdalla
76-clark
406-venture

while reading from folder by using Directory.GetFiles(this.OutputFolder) iam getting order in this way

00001-just
00002-sar
00003-emm
00004-kat
00005-sall
406-venture
54-frank
59-king
63-abdalla
76-clark


pls help me out......i want the same order which i have in outputfolder ..while getting files from folder.....




Responses

Posted by: Sakthi.Singaravel on: 6/5/2012 [Member] Silver | Points: 25

Up
0
Down
Normally system reads the values as 1st char, 2nd char order....

0 0001-just
0 0002-sar
0 0003-emm
0 0004-kat
0 0005-sall
4 06-venture
5 4-frank
5 9-king
6 3-abdalla
7 6-clark

In my knowledge, u can't change the order..



Regards,
Singaravel M

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 6/5/2012 [Member] Silver | Points: 25

Up
0
Down
Maintain ur input folder name Charaters as same count...

like this,

00001-just
00002-sar
00003-emm
00004-kat
00005-sall
00054-frank
00059-king
00063-abdalla
00076-clark
00406-venture

Now u can get ur expected output...

Regards,
Singaravel M

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response