Jump to content

_FileListToArray problem


Recommended Posts

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

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.

@dantay9

Thanks for your reply. I shall try running the script on another PC.

Thanks again.

Ajit

Link to comment
Share on other sites

Try a different folder. Maybe it is just that folder.

@dantay9

I have tried multiple folders; the problem is persistent, i have tried with different number of files(5-1000 files) with different extensions.

Thanks anyway.

Regards

Ajit

Link to comment
Share on other sites

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

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.

@dantay9

Thanks very much for your help. I shall try your suggestions.

Regards

Ajit

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...