Sort a table 2D

Hello everyone,

Can someone please help me in sort of a 2D array. Here's the requirement there will be some groups and each group is composed of 'x' number of items. The user enters only the elements but in a zig zag order. And the short program of sorting on each channel and on the list to which group membership (where the name of group and elements 2D table is provided).

Say, for example, if there are three groups with some elements in each of the groups as follows.

Physics: speed bump, force, torque, capacity

Chemistry: reaction, chemicals, sodium

Geography: Earth, map, soil, Earth.

And if the user enters the following entry: couple, produced chemical, power, reaction, ground, Earth.

The program should return the following result:

Note: The order of the elements must match the order they are defined.

Physics, force, torque-group name and group in the first row elements

Chemistry, reaction, chemical - group name and group items in the second row

Geography, Earth, soil - group name and group items in the third row

Thanks for the help

-Rambeau


Tags: NI Software

Similar Questions

  • How to obtain an alphabetical pages when not sorting a table

    How can I get an alphabetical pages when NOT sorting a table?

    You use the service "Sorting lines increasing" in the free collection of services WordService from the OS X App Store.

    You have a vertical stacking of items, each end with a return, that you want to sort. Select you the list, and in a blink of an eye, you sort using the application menu Pages: Services: WordService: ascending lines.

    Exit Pages.

    When you download WordService from the OS X App Store, it will install its different Services, but not to allow them. You find the (s) you want enabled in system preferences: keyboard Panel: tab shortcuts: Services (scroll down in the list in the right panel)

    Open your document in Pages, select your list, and you will find the option to sort the items alphabetically now exists as described above.

  • Script to sort the table in ascending order

    Hello

    I am not able to find any manufacturer of chassis function to sort the table in ascending order with respect to column 1. Please, guide me how I can write the script extended chassis manufacturer to sort the table.

    Thanks and greetings

    Libson

    Here's how you can sort a table with ExtendScript:

    #target framemaker
    
    var doc = app.ActiveDoc;
    // Set a variable for the selected table.
    var tbl = doc.SelectedTbl;
    
    // Select the table.
    tbl.MakeTblSelection (Constants.FF_SELECT_WHOLE_TABLE);
    
    // Sort the table.
    CallClient ("TableSort", "row nocase 0 ascending -1 ascending -1 ascending");
    

    Here's the FDK Programmers Reference for TableSort settings information:

  • Sort by table headers

    Does anyone know a way to make the titles of the header of a whiteboard so that a user can sort the table by a column heading given?

    I use PHP with a MySQL database data using the repeat function.

    I tried this option which is what I would do, but it does not work.

    http://www.kryogenix.org/code/browser/SortTable/

    See you soon

    Thanks for the link, rhe solution worked well.

    see you soon

  • Tenaris the sorted string table section and put it at the beginning

    Hi all

    I have an array of sorted strings (see ataached), which contain strings, numeric as T1 - T2, T1-1... T8-1 T8-2... T32-1. I want to do is to select the completeT8 and T9 parts and put it at the beginning of the table keeping remaining table sorted. Is it possible to do so. I try to match and replace without becoming confused in its use.

    Thanks for the help.

    Ankit G

    "Strings of tooth (out)" contains your original sorted table "tooth Strings (en)" with T8 and T9 at the beginning.  There is no deleted items or repeated. The code is attached.

  • Problem of sorting of tables and... Using the functionality of the case

    OK, so im do this bit of code that solves the linear equations of 3 x 3, I have most of the code actually lack just 2 small pieces for value of ascetics, garlic try to describe them as detailed as I can, no matter what type of advice or advice with any of them would be greatly appreciated

    Some details of the program:

    Equation MUST be entered in a string and not must (and probably should) be able to do some difficult fixing

    It will be limited to the +'s and-'s signs

    Problem 1.

    I don't really know how to 'sort' my equation according to their variables, example:

    User input: - 2 y + 1 * x z - 1 = 2

    I can make it look like: - 2 y + z - 1 x 1 = 2

    I want what it looks like: 1 x-2 y - 1 z = 2

    I can handle sort the equation, IF I knew the order the user will add variables, the only thing that comes to mind is turning them into a table and make a case for each (x, y, z - x, z, y - etc.) and by using some kind of process of elimination to choose the table 'longer or shorter', I really haven't got much if this because it seems like a stupid idea , but it's the only thing it comes to my mind.

    Problem 2.

    So as im fixing the spaces between characters, at least, I find a '10', I don't want one "1 0", very roughly, I managed to work around this problem by using a "find and replace String", but I'm having trouble making a "case" for her, as in, I can't understand the entry of 'right' to a string of cases. " example:

    User input: 1 x-2 y - 1 z = 12

    The result inside the box is correct and resembles a '12', but as I don't know the correct entry, obviously my default case is empty, and it passes through, so the result on the outside is a '1 2 '.

    Any link for someone who fixed a similar problem or guides would be great, I'd also like to announce that 3 weeks ago, I've not even knew what was "LabVIEW", if you can 'dumb down' a little explanation would be greatly appreciated.

    You can try to use php code Analyzer to help analyze. The joint was a quickly hacked together solution that makes several assumptions (a big one being that the entry is correct and equal to is the last thing). This isn't really a complete solution.

    Sorry I didn't have the time to comment on it. If it seems odd, I was using money orders that got lost, when I recorded it for the previous version.

  • How to sort a table double in blackberry?

    I need to sort a double table containg frequencies. I have java we can do by the method "Arrays.sort (). But Blackberry does not support table double sorting with this method. Someone has any idea how to do? Thank you.

    implement your own sorting algorithm must be covered by each course programming first half, I'm sure you can find many of them online.
    If this sounds too awkward, you could use instead of double [] objects and set up your own comparison.

  • VCO 5.5 - How can I sort a table / VC:VirtualMachine resource pool?

    Hello

    I want to sort a VM of their resource pool table.

    I tried a few things from various research but none of them does not seem to work, but I can't find a lot of reference material.

    where WindowsVMs is an array / VC:VirtualMachine

    WindowsVMs = WindowsVMs.sort (sortVMs);

    I tried these two functions, I also tried the same thing with the name of the virtual machine as a sorting criterion. Doesn't seem to work and the System.log does not create an entry.


    function sortVMs(a,b) {}
    return (a.resourcePool.name > b.resourcePool.name);
    System.log ("0");
    }

    function sortVMs(a,b) {}
    var vmA = a.resourcePool.name.toLowerCase ();
    var vmB = a.resourcePool.name.toLowerCase ();

    If (vmA < vmB) {string ascending //sort
    Returns - 1
    System.log ("1a < B");
    }
    If (vmA > vmB) {}
    Returns 1
    System.log ("1a > B ');
    }

    Returns the return value 0 //default (no sorting)
    System.log ("0");
    }


    Any thoughts?

    Concerning

    Mark

    I have managed to get this to work using this function

    function sortVMs(a,b) {}

    If (a.resourcePool.name == b.resourcePool.name) {}

    return 0;

    } ElseIf (a.resourcePool.name > b.resourcePool.name) {}

    Return 1;

    }

    Returns - 1;

    }

  • How to sort a table in descending order by default?

    Hi all

    I created a sample page that is research panel with table. His works well
    When searching in the table, I want to display the data in the table in descending order by default.
    For example, I have one of field's ID who's number I want to display the table in descending order.
    But we have an option that can be sorted and sort property in the behavior section. But if we want a default search, how to make.
    Can someone give a resolution?


    Thank you
    Shankar

    cant specify you desc order in the query in the t?

  • Cannot sort a table

    Hi all

    The Table > Sort command is grayed out in my verse. FrameMaker. I have 8.0p277 on Windows XP Professional. (Yes, I know it's all the old, but that is what offers the company where I work.)  I tried to select an entire table, a column, lines, by clicking in the table. Do check the command from main menu, context menu and the keyboard shortcut for sorting. Also leave Frame and restarted my computer.  Nothing helps. Your ideas would be very appreciated.

    Gloria,

    Check your \fminit\Plugins to the presence of the tablesort.dll

    If this isn't there, then he got somehow wipe it (maybe someone clean other plug-ins?) and the menu item has nothing to run.

  • What is the best way to make a sort of table?

    Hello world

    Twice a year, our magazine prints financial reports for our Organization. The layout is always exactly the same thing: the only thing that changes are the numbers. I have the exactly how I want. The workflow easier (but less efficient) was to manually replace the numbers each time, typing hand.

    I was wondering if there was something of a slick way to automate this process. Financial data is delivered in a native Excel file. I was wondering if I could set up some sort of thing where InDesign can read raw data from another application?

    No matter what come to mind?

    Thank you

    You import text from excel, it is a table.

    As long as the table has the exact same lines and columns, in the same configuration.

    You can convert the table to text, insert a TAB for the separation of the columns and the paragraph for columns when asked

    You can then copy and paste the text in the table.

  • Sort the table of Foundtext and respective Page number

    Hi all

    I'm a novice scripter. It is also my first Indesign script. Please help anyone for my first script. Here is my requirement.

    I want to generate a text style applied to particular character with belonging "number of Page. Also, I need to sort the text found in alphabetical order with the belonging itself page number. I have generated just the text and the page number for membership by writing the following code.

    myDoc var = app.activeDocument;
    var myDocPath = app.activeDocument.filePath;
    var myDocName = app.activeDocument.name;

    app.findTextPreferences = null;
    app.findTextPreferences.appliedCharacterStyle = myDoc.characterStyles.item ("Test");
    var myText = myDoc.findText ();
    var myPageNumber = new Array;
    var myFoundText = new Array;
    var myFoundTextSort = new Array;

    for (var i = 0; i < myText.length; i ++)
    {
    myFoundText.push (myText [i] .silence);
    }

    for (j = 0; j < myText.length; j ++)
    {
    var r = getPageFor(myText[j].characters[0]);
    myPageNumber.push (r.name);
    }

    var inc = 0;
    var myLogFile = new File (myDocPath.fsName + "/ Text_Report_" + app.activeDocument.name.split(".")) ([0] + ".log");
    If (myLogFile.open ("w", defined, undefined))
    {
    if(myFoundText.Length!=0)
    {
    for (var k = 0; k < myFoundText.length; k ++)
    {
    SERIALNO = k + 1;
    myLogFile.writeln ("" + serialno + ".")  ' + myFoundText [k] + "-Page" + myPageNumber [k]);
    }
    }
    }

    myLogFile.close ();
    myDoc.close ();

    function getPageFor (element)
    {
    While (!) (element instanceof Page) | element instanceof request))
    If (element instanceof character)
    item = element.parentTextFrames [0] .parent;
    on the other
    item = element.parent;
    If (element instanceof Page)
    Returns the element;
    Returns a null value.
    }

    Please help anyone. Thanks in advance

    Well, you're almost there. The current problem is in your push instruction. Array.push (...) peut push more than a single element in the table, but it will do so in single shoot; This is why you do not get the composite objects back, but each has pushed point on its own place.

    So either use the method of Kasyan and create a composite object

    PAGEText.push ({pageNumber: 5, text: "this is some text 5 '});

    either way, in a table:

    MYFoundText.push ([MYResults [i] .silence, r.name]);

    Whatever it is, you have to adjust your sort code for what you choose.
  • Problem in sorting the table advacned attribute

    Hi all

    Everyone please help me sort the column Advanced because I need readonly columns but when I sort in converted writable format...

    Thanks in advance

    Hello

    ColoumnHeaderPrompt ther is a property; All sort and set the Initila Staus.

    WHT is the style of columns in advance Table RN...? IF you want to only read only go to "MessageStyledText".

    Nani

    Published by: Nani652595 on February 24, 2010 22:06

  • Sort a table

    Hi all
    I'm working on a specific application that needs an array is sorted according to a specific property of an object that is an element of the array.

    for example

    I have a table like [{name: "jhon", sal: 1200}, {name: 'bob', sal: 1400}, {name: 'kelly', sal: 1600}]. This table is sorted by name or the salary that I ever want to (means with a dynamic decision). Is it possible to do this in flex? I have same urgency about this... can someone help me in this problem.

    Thank you

    See http://livedocs.adobe.com/flex/201/langref/Array.html#sortOn)

  • Sort a table of strings [problem]

    Well, im pretty new in the java development and app, I used to make games using AS3 and now I am with my teacher in certain BlackBerry applications.

    The thing is I can't sort an array of string, I looked around and I noticed that I need to make a comparison.

    I want to sort an array of XML that will be used on a drop-down list. How can a comparator and use it?

    Easy PS:go on me, im really new ^^

    Which part of this is a problem with? Looks like things fairly straigh-forward.

    You write a class that implements the comparison. You have two methods to implement, compare() and equals(). Each method is passed two objects. It is the responsibility of your application to prvide the good performance based on the two objects.

    Since your comparator compares strings, you have already integrated routines to compare.

    String.compareTo)

    and

    String.Equals)

    In both cases, you can simply return the value of the construction compared with chains.

    See the javadocs for comparator, String, and SimpleSortingVector

    Work on it a bit and come back with a more specific question.

Maybe you are looking for