ajit Posted June 21, 2009 Share Posted June 21, 2009 Hi: When i try to enlist files using _FileListToArray the last file is always enlisted first. There is no problem with other files. Only the last file comes first. Could someone help me with this. Thanking in anticipation. Regards Ajit. The code below almost straight from helpfile: #include<File.au3> $folder = FileSelectFolder("Select Folder", "", 2) $avCommon = _FileListToArray($folder) $sFile = @ScriptDir & "\Test.txt" ; Write array to file by string file name _FileWriteFromArray($sFile, $avCommon, 1) ; Display results Run("notepad.exe " & $sFile) Link to comment Share on other sites More sharing options...
dantay9 Posted June 21, 2009 Share Posted June 21, 2009 I ran the script and got the files to be in alphabetical order. The last one wasn't first. I can't help you if the error isn't reproducable. Link to comment Share on other sites More sharing options...
ajit Posted June 21, 2009 Author Share Posted June 21, 2009 I ran the script and got the files to be in alphabetical order. The last one wasn't first. I can't help you if the error isn't reproducable.@dantay9Thanks for your reply. I shall try running the script on another PC.Thanks again.Ajit Link to comment Share on other sites More sharing options...
dantay9 Posted June 21, 2009 Share Posted June 21, 2009 Try a different folder. Maybe it is just that folder. Link to comment Share on other sites More sharing options...
ajit Posted June 21, 2009 Author Share Posted June 21, 2009 Try a different folder. Maybe it is just that folder.@dantay9I have tried multiple folders; the problem is persistent, i have tried with different number of files(5-1000 files) with different extensions.Thanks anyway.RegardsAjit Link to comment Share on other sites More sharing options...
dantay9 Posted June 21, 2009 Share Posted June 21, 2009 Just to be clear. The files are in alphabetical order, but the last file (around z) is the first file and the first file (around a) is the last file. The first and last files are swapped. If you can't find the answer, you could just swap the two positions or just use ArraySort. See if that works. Link to comment Share on other sites More sharing options...
ajit Posted June 21, 2009 Author Share Posted June 21, 2009 Just to be clear. The files are in alphabetical order, but the last file (around z) is the first file and the first file (around a) is the last file. The first and last files are swapped. If you can't find the answer, you could just swap the two positions or just use ArraySort. See if that works.@dantay9Thanks very much for your help. I shall try your suggestions.RegardsAjit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now