Sorting

Sorting a file structure

sorenknud's picture

Hi there, i use the Kineme Directory Scanner (Blocking) to get a list of files.

First: What are they sorted by by default? It does not seem to be - alphabetical?

Second: I cannot figure out how to make a "Sorting Descriptor" in the "Structure Sort" patch...

I simply want to list my files like this:

01_file-blka 02_file-blabla 03_file-tika

But they come in "random" order.

Any clues?

Thanks a lot!

best, soren

Structure subtlety

yanomano's picture

This is probably an idiotic question but, in a structure of structures, is there a way to retrieve the name of an index when the structure has been reordered ?

See the jpeg as example : The first index (0) is named "9" : how to retrieve this number/name ?

A method without javascript would be ideal because the work is done inside an iterator !

Thanks for the kind help !

Sorting arrays and splitting arrays in Javascript

usefuldesign.au's picture

Javascript help for novice coders like me!

Apart from the fact that the JS patch is temperamental — requiring restarts of QC application when it will not parse good script — I attempted to clear up some of the mysteries I had around working with 2D datasets in Javascript. Standard JS array methods that work for 1D arrays often don't work for more complicated array structures.

This composition has three demo JS patches for:

splitting a set of points into two sets (odds and evens by index), sorting an array of dictionaries by a common dictionary key (a-Z) & concatenating both internally created and inputed structures into one array

All the code is well commented, I hope it can save some of the suffering for others that the JS patch has given me. So let me know if it does and I will have been rewarded for posting it.