I import CSV files which have various headers.
Is there a way to simply keep only the ones I need and in the order I need them in?
For example, if the array's first row's values are Foo Bar Test This, then I want to turn them to Foo This Bar.
Here's how I do it "manually" with _ArrayColDelete and _ArraySwap, but I want to use something smarter like rearrange($aArray, ["Foo", "This", "Bar"]):
#include <Array.au3>
Local $aArray[4][4] = [["Foo", "Bar", "Test", "This"], [1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
_ArrayDisplay($aArray, "Original")
_ArrayColDelete($aArray, 2) ;2 stands for Test, but next time Test might not be 2, but it will still be called "Test"
_ArraySwap($aArray, 1, 2, true) ;1 and 2 might be different next time, but their names will remain
_ArrayDisplay($aArray, "Modified")
If it helps, I do the same thing in VBA based on Sub Reorganize_columns (the second/alternative example in that page).