pintas Posted June 3, 2011 Share Posted June 3, 2011 I want the _FileListToArray to display only '.docx' files, but i want the results to appear in _ArrayDisplay without the '.docx' in it. My thinking seems correct but the result tells me it's not. The _ArrayTrim would trim the results to the right in 5 characters. What is wrong with this? #include <Array.au3> #include <File.au3> $FileList =_FileListToArray('D:\WordDocs\','*.docx',1) $FileListNoDocx = _ArrayTrim($FileList, 5, 1) _ArrayDisplay($FileListNoDocx) Link to comment Share on other sites More sharing options...
sahsanu Posted June 3, 2011 Share Posted June 3, 2011 What is wrong with this? #include <Array.au3> #include <File.au3> $FileList =_FileListToArray('D:\WordDocs\','*.docx',1) _ArrayTrim($FileList, 5, 1, 1) _ArrayDisplay($FileList) Link to comment Share on other sites More sharing options...
pintas Posted June 3, 2011 Author Share Posted June 3, 2011 Yet again you saved me. Still don't understand why it doesn't work... Thanks! Link to comment Share on other sites More sharing options...
sahsanu Posted June 3, 2011 Share Posted June 3, 2011 Yet again you saved me.Still don't understand why it doesn't work...Thanks!It doesn't work because _ArrayTrim function trims a certain number of characters from all elements in an array but DOES NOT create a new one so it is modifiying the existing array $FileList.You are welcome Link to comment Share on other sites More sharing options...
pintas Posted June 3, 2011 Author Share Posted June 3, 2011 It doesn't work because _ArrayTrim function trims a certain number of characters from all elements in an array but DOES NOT create a new one so it is modifiying the existing array $FileList.You are welcome Ah, now i understand. 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