fill IN ARRAY A FILE NAME IN DIR

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

fill IN ARRAY A FILE NAME IN DIR

Post by sal21 »

Possible to fill an array with a sorted file in dir, by name of state?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78453
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: fill IN ARRAY A FILE NAME IN DIR

Post by HansV »

Loop through the folder and fill an array with the file names.
In the loop, also extract the country name and fill a second array with the country names.
Then, sort the country name array in ascending order and sort the file name array at the same time.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

Re: fill IN ARRAY A FILE NAME IN DIR

Post by sal21 »

HansV wrote:
11 Feb 2022, 16:31
Loop through the folder and fill an array with the file names.
In the loop, also extract the country name and fill a second array with the country names.
Then, sort the country name array in ascending order and sort the file name array at the same time.
ok. tks

User avatar
SpeakEasy
4StarLounger
Posts: 548
Joined: 27 Jun 2021, 10:46

Re: fill IN ARRAY A FILE NAME IN DIR

Post by SpeakEasy »

Or you could use an ArrayList with a custom sort method ... (just to be clear - you don't have to write the sort routine)