Simple and robust Action Block made to sort an array by 2 criteria:
- Alphabetical (default)/Numerical order*
- Increasing (default)/Decreasing order
INPUT:
- ArrayIN (compulsory) = the one-level array to be sorted
- DecreasingOrder = boolean variable set to False by default
- NumericalOrder = boolean variable set to False by default
- Sep = string variable containing separator character (default ¶) between array elements/file records**. Replace it by a character which is not supposed to be present in ArrayIN
OUTPUT:
- ArrayOUT = sorted array according to sorting criteria
*: assuming ArrayIN contains following elements:
#0->4
#1->2
#2->10
#3->1
In Numerical increasing order the sorted result will be:
#0->1
#1->2
#2->4
#3->10
In Alphabetical increasing order the sorted result will be:
#0->10
#1->1
#2->2
#3->4
In Alphabetical increasing order uppercase letters come before lowercase ones
**: to optimize sorting procedure, this Action block uses Script Sort command to sort file records. So, it first converts ArrayIN to "/storage/emulated/0/MacroDroid/Unsorted.txt" temporary file which is sorted according to input parameters (see above). Then it converts it into ArrayOUT
- Alphabetical (default)/Numerical order*
- Increasing (default)/Decreasing order
INPUT:
- ArrayIN (compulsory) = the one-level array to be sorted
- DecreasingOrder = boolean variable set to False by default
- NumericalOrder = boolean variable set to False by default
- Sep = string variable containing separator character (default ¶) between array elements/file records**. Replace it by a character which is not supposed to be present in ArrayIN
OUTPUT:
- ArrayOUT = sorted array according to sorting criteria
*: assuming ArrayIN contains following elements:
#0->4
#1->2
#2->10
#3->1
In Numerical increasing order the sorted result will be:
#0->1
#1->2
#2->4
#3->10
In Alphabetical increasing order the sorted result will be:
#0->10
#1->1
#2->2
#3->4
In Alphabetical increasing order uppercase letters come before lowercase ones
**: to optimize sorting procedure, this Action block uses Script Sort command to sort file records. So, it first converts ArrayIN to "/storage/emulated/0/MacroDroid/Unsorted.txt" temporary file which is sorted according to input parameters (see above). Then it converts it into ArrayOUT
Last edited: