After extracting data from PDF files, I found myself with a vast array of information. Each PDF page contained 10 data items arranged in two columns, causing the data to be shuffled. While the first and last items were correctly positioned within each group of ten, the rest were mixed up.
Currently, the order of the data is 0, 2, 4, 6, 8, 1, 3, 5, 7, 9, 10, 12, 14, 16, 18, 11... but I require it to be in sequential order starting from 0, 1, 2, 3...
I have attempted to iterate through the array and transfer items into a new array using various if statements, yet I seem unable to achieve the desired outcome.