Array spreadshee​t format

Anyone can help I have a CAN message logged from a TDMS file and wanted it to convert to a csv or a txt file with the following channel groups:
CAN ID, CAN Message, Timestamp, TX/RX
However the result that I got on my text file is not the same as the result from the TDMS.
I mean the layout becomes like this:
CAN ID, CAN Message,
Timestamp, TX/RX
I am wondering why does the Timestamp and TX/RX were put on the next line?
This is the snapshot of my code, anyone can help?
Thank you

Your real problem is likely in the program that creates the TDMS file.  It is likely adding the End Of Line characters to the data string.  My magic 8 ball says you use Array To Spreadsheet String on the data to then save it to the TDMS file.  You should use the Trim White Space after the Array To Spreadsheet String in order to prevent that.
As far as your conversion program, you can use Index Array to get the data column, a FOR loop with the Trim White Space, and then Replace Array Subset to remove the EOL characters and then save it to your text file.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Combine Columns From Separate Arrays Into One Formatted Table

    What I'm trying to do is make two WMI queries with 2 different classes for a list of machines and then patch the columns together into one single array that is formatted as a table with columns and rows. I seem to keep banging my head against the wall and
    I can't help but feel that the answer is simple. I can certainly create an array that contains all 3 columns (such as in the commented out part) but no matter which angle I go at it, it always seems to end up as all the data in one single row in each column
    rather than a nicely formatted table. I've even tried constructing separate custom objects and adding the different objects to the array but that's obviously not working. Below is the code of the last thing I tried. I need someone to bash it to death and tell
    me the (most likely obvious) thing that I'm doing wrong. Thanks!
    $failedos = @()
    $failedcs = @()
    $ccs = get-adcomputer -property operatingsystem -filter {name -like "*-CC*"} | select name | sort name
    $cs = foreach ($cc in $ccs){$cc.name | % {if ($c=get-wmiobject -computername $cc.name -class win32_computersystem -ErrorAction SilentlyContinue){$c | select @{Name="Name";Expression={$_.Name}}, @{Name="Model";Expression={$_.Model}}} else {$failedcs += "$_"}}}
    $os = foreach ($cc in $ccs){$cc.name | % {if ($o=get-wmiobject -computername $cc.name -class win32_operatingsystem -ErrorAction SilentlyContinue){$o | select @{Name="OperatingSystem";Expression={$_.caption}}} else {$failedos += "$_"}}}
    #[array]$osprops = @{'Name'=$cs.Name;'Model'=$cs.Model;'OperatingSystem'=$os.OperatingSystem}
    $result = @()
    Foreach ($Line in $cs) {
    $MyCustomObject = New-Object -TypeName PSObject
    Add-Member -InputObject $MyCustomObject -MemberType NoteProperty -Name "Name" -Value $Line.name -Force
    Add-Member -InputObject $MyCustomObject -MemberType NoteProperty -Name "Model" -Value $Line.Model -Force
    $result += $MyCustomObject
    foreach ($Line2 in $os) {
    $MyCustomObject2 = New-Object -TypeName PSObject
    Add-Member -InputObject $MyCustomObject2 -MemberType NoteProperty -Name "OperatingSystem" -Value $Line2.OperatingSystem -Force
    $result += $MyCustomObject2

    Any help?
    $ccs = get-adcomputer -property operatingsystem -filter {name -like "*-CC*"} |
    select -ExpandProperty name | sort
    $Result =
    Foreach ($CC in $CCs)
    $Object =
    New-Object PSObject -Property @{ Name = $CC
    Model = 'Failed'
    OperatingSystem = 'Failed'
    Try {
    $Object.Model =
    get-wmiobject -computername $CC -class win32_computersystem -ErrorAction Stop |
    select -ExpandProperty Model
    $Object.OperatingSystem =
    get-wmiobject -computername $CC -class win32_operatingsystem -ErrorAction Stop |
    select -ExpandProperty Caption
    Catch{}
    Finally { $Object }
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Problem in conversion of file into array of proper format

    how to do following 
    1) TO RETREIVE ALL THE SET OF STRING LOGGED 
    BETWEEN THE TIMINGS THAT IS GIVEN BY USER AS INPUT AND THE FORMAT TIMINGS OF IS BEING ATTACHED IN DEMO.DOCX 
    THIS IS ONE OF THE SET
    RQ_TM::11:28:41
    68556885844D13E9516
    RS_TM::11:28:42
    68B5B5688485A3E10C10000002D1800000000007F00C10000002D1800000000107F00C10000002D1800000000107F00C10000002D1800000000107F00C10000002D1800000000107F00C10000002D1800000000107F00C10000002D1800000000107F00C10000002D1800000000107F0F116 
    detailed problem is explained in document attached.
    Attachments:
    14-2-14.txt ‏59 KB
    demo.docx ‏145 KB

    Hi priya,
    well, I would start to search for timing information. Then I would pick all lines between the requested timestamps…
    I guess that is homework and you get some points/notes/grades for it. So please do your job on your own.
    Ask for specific problems but not for general solutions!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Printing a 2d array in matrix format

    Hi everyone- first time posting here... I'm an undergrad CS major at the Colorado School of Mines. I'm trying to write a metho that will print out a 2D array (3x3) in matrix form. Here is what I have:
    public static void printArray(int[][]array3){
    for (int i=0; i<array3.length; i++)
    for (int j = 0; j<array3[0].length; j++) {
    int count=0;
    if (count % 3 ==0){
    System.out.println(array3[i][j] + " ");
    count++;
    else{
    System.out.print(array3[i][j] + " ");
    count++;
    All it does is list the elements of the array as follows.
    Sample:
    1, 2, 3 input array
    prints:
    1
    2
    3
    Any help would be appreciated.

    1 public static void printArray(int[][]array3){
    2       for (int i=0; i<array3.length; i++)
    3         for (int j = 0; j<array3[0].length; j++) {
    4           int count=0;
    5           if (count % 3 ==0){
    6             System.out.println(array3[i][j] + " ");
    7             count++;
    8           }
    9           else{
    10             System.out.print(array3[i][j] + " ");
    11             count++;
    12           }
    13         }
    14     }Lets just run through it, step by step
    -1
       i = Out of scope
       j = out of scope
       count = out of scope
    -2
       i = 0
       j = out of scope
       count = out of scope
    -3
       i = 0
       j = 0
       count = out of scope
    -4
       i = 0
       j = 0
       count = 0
    -5
       i = 0
       j = 0
       count = 0
       (count % 3 ) = 0
    -6
       i = 0
       j = 0
       count = 0
       print 1<new line>
    -7
       i = 0
       j = 0
       count = 1
    -8
       i = 0
       j = 0
       count = 1
    -13
       i = 0
       j = 0
       count = out of scope
    -3
       i = 0
       j = 1
       count = out of scope
    -4
       i = 0
       j = 1
       count = 0Hint: You don't need count, you have a counter (i*3)+j, and even a counter than just goes between 0 to 2.

  • Easy Question re spreadshee​t format

    Hello,
    I am trying to take data from a ascii tab-delimited file with 2 columns
    and plot the first column versus the second column.
    I am using the "read from spreadsheet file" VI from the functions menu
    and the output is a 2 (or 3?)-d array.
    I can't figure out how to plot this. I tried using XY plot but it would
    not wire up. I think that I need to somehow split the arrays and then
    bundle them for input to the XY graph.
    Any Suggestions would be greatly appreciated!
    Thanks
    Jonathan Sexton
    Department of Chemistry
    UCSD

    Here you go, easire than explaining
    Jonathan Sexton wrote in message <[email protected]>...
    >Hello,
    >
    >I am trying to take data from a ascii tab-delimited file with 2 columns
    >and plot the first column versus the second column.
    >
    >I am using the "read from spreadsheet file" VI from the functions menu
    >and the output is a 2 (or 3?)-d array.
    >
    >I can't figure out how to plot this. I tried using XY plot but it would
    >not wire up. I think that I need to somehow split the arrays and then
    >bundle them for input to the XY graph.
    >
    >Any Suggestions would be greatly appreciated!
    >
    >Thanks
    >
    >Jonathan Sexton
    >Department of Chemistry
    >UCSD
    >
    [Attachment Graph XY from Spreadsheet.jpg, see below]
    Attachments:
    Graph_XY_from_Spreadsheet.jpg ‏10 KB

  • Get data from array in Number format

    Ive got this array with numbers in it, which i want to use for some simple calculations, but i keep getting the message that the array data isnt a number:
    The whole is in a for loop, with teller1 as increasing value.
    the code:
    var xco:Array = [180,233,271,292,292,270,231,179,124,74,34,11,9,30,70,121];
    var yco:Array = [11,33,73,124,181,232,270,290,291,271,234,183,125,72,33,11];
    for(var teller1=1; teller1<33; teller1++) {
        var ringsegment_mc:Ring_1=new Ring_1();
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);
        switch(teller1) {
         case 16:
         //kernplaats=Math.random()*600+300;
         kernplaats=Number(400);
         trace (yco[teller1]);
         trace (yco[teller1]+kernplaats);
    so the trace functions give:
    undefined
    NaN
    so i tried using this:
    trace (yco[3]);
    trace (yco[3]+kernplaats);
    which gave this:
    124
    524
    so something is going wrong when trying to read the array, but what? and how can it be fixed/

    I don't know what you are after, but if you want to use the same loop twice, then put it inside another loop... (note that arrays start at index 0, not 1)
    for(var i=0; i<2; i++){
      for(var teller1=0; teller1<16; teller1++) {
        var ringsegment_mc:Ring_1=new Ring_1();
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);
        switch(teller1) {
         case 16:
         //kernplaats=Math.random()*600+300;
         kernplaats=Number(400);
         trace (yco[teller1]);
         trace (yco[teller1]+kernplaats);

  • Spreadshee​t formatting

    Hellooo! I posted somethign a while ago, but I'm not sure that anyone's reading it anymore...
    The question is:
    Now I have a VI in a very very stylish loop, to write information to a .xls file. However, I've encountered a couple of problems.
    1. Everytime the loop runs again, it asks for the file name. I thought that creating a shift register was supposed to solve that problem, but apparently it didnt.
    2. My data that is stored into the xls file is not well formatted. Instead of being well ordered:
    Date Date
    Time Time
    0.1455 0.12556
    etc...
    it comes out like:
    date
    Time
    0.1255 Date
    Time
    0.4514
    etc...
    I want my information to be in a horizontal line so it'll be easier to graph out the information in the future.. please help!
    Thanks!
    Aquaphire
    ---USING LABVIEW 6.1---

    A few problems with that VI:
    If using a shift regster, you also would need to wire the path across in the FALSE case. If not, the path will revert to an empty path.
    Solution: Don't use a shift register for the path, just wire it in via a plain tunnel, It never changes.
    Better
    Open the file outside the loop, write using low lever file I/O inside the loop, close the file outside the loop on the right. Currently you are constantly opening-writing-closing the file. This is like running a marathon, but taking the shoes off, then putting them pack on after each step. Lot's of effort for nothing.
    Also all the other shift registers have no function at all, they only feed empty strings to the recording case. (Unless somebody would be fast enought to constantly press the button, in which case, you'll write duplicate entries (AABABCABCDABCDE...)). Eqqually bad.
    Solution:
    Remove all shift registers and remove the top terminals of the concatenate string functions.
    LabVIEW Champion . Do more with less code and in less time .

  • Text arrays (variables) and Dynamic Text Box

    Hello everyone. I have a text file (let's call it sample.txt)
    that has numerous variables or arrays in this format:
    &info=This is some information
    &stuff=This is more stuff
    &whatever=Even more stuff again....
    Anyway, I need to load a particular variable via individual
    buttons from this same sample.txt file into a dynamic text box
    (let's call it dynText), and I am a bit lost as to how to do it.
    Please provide me a solution thank you.
    Glenn

    Thank you very much, it's greatly appreciated. It worked
    perfectly except that it does not like variables that begin with
    numbers like:
    &401_2b=401_2b
    The above doesn't work, but if I do this...
    &h401_2b=401_2b
    Everything is fine. Problem being, I am generating the
    variables via PHP and therefore cannot "change" them. Can you
    provide me with a way that ActionScript can "see" the variable that
    starts with a numeric value? Thanks for your time.
    Glenn

  • Spreadsheet to array

    Hi,
    I am trying to read from a spreadsheet.
    PressDir=-1,1,-1,1
    how would I make this work?
    I think my conversion code is wrong. 
    But I have tried everything.
    Message Edited by krispiekream on 04-06-2010 11:13 AM
    Best regards,
    Krispiekream
    Solved!
    Go to Solution.

    TurboPhil wrote:
    Judging from your screencapture, it looks like you want your variable "PressDir" to be represented as an iteger. Therefore, I assume you want to be able to read in a spreadsheet string as a boolean array, and then format the boolean array into an integer. (i.e. the array [1,0,0,1] would translate to the number 1001 in binary, or 9 decimal).
    Many things don't make a lot of sense here. Why would you scan it as a DBL array since there are only integers? The original problem has 1 and -1, not 1,0, and we don't know what other possible value there are, maybe -1, 0, 1? I also would not reverse the array, else you get assignment problems if the length changes.
    Here'as one possible alternative, showing both how to make a -1, 1 array and a bit representation of it.
    Message Edited by altenbach on 04-06-2010 12:28 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    array.PNG ‏9 KB

  • Format code Adobe Flash CC 2014 Broken

    I just upgraded from Adobe Flash CS6 to Adobe Flash CC 2014 and I noticed that Adobe changed how the "Format Code" command formats a Greensock code line (arrays). Does anyone have a workaround or solution?
    The way CS6 formated a line of Greensock code (my preferred way):
    TweenLite.to(mc, 1.5, {x:100, y:200, rotation: 360, ease:Expo.easeInOut, delay:1});
    How it formats now in CC 2014:
    TweenLite.to(mc, 1.5,
        x: 100,
        y: 200,
        rotation: 360,
        ease: Expo.easeInOut,
        delay: 1

    Usually the easiest fix for something that CC does differently is to revert to using the version that you are comfortable with... CS6 in this case.  Personally, I manage all the formatting of my code and don't rely on any built-in tool for it.  Built-in coding stuff in my opinion is always a mess - as evidenced by any html page ever produced by MS Word.
    I am not sure why you mention arrays since the formating only appears to have affected the Object that is defined as one of the tween's arguments.  The way it is formatted makes it easier to read the properties of the Object. I wouldn't say it is broken, it is just done the way someone who writes the program decided they like it to be shown.

  • Re: Encode THAI Language into BASE64 Format

    Hi  Guru's,
            Have a requirement  to encode particular IDOC text fields which are in  THAI language to BASE64 format . We are able to encode the same for english but not able to do the same for Thai language so can any one help with the coding to create custom UDF  which can convert.
    Regards
    Sathish Kumar K.C

    Hi ,
       Please find below my code...
    public class Base64a {
    //     Mapping table from 6-bit nibbles to Base64 characters.
    private static char[]    map1 = new char[64];
         static {
            int i=0;
            for (char c='A'; c<='Z'; c+) map1[i+] = c;
            for (char c='a'; c<='z'; c+) map1[i+] = c;
            for (char c='0'; c<='9'; c+) map1[i+] = c;
            map1[i+] = ''; map1[i++] = '/'; }
    //     Mapping table from Base64 characters to 6-bit nibbles.
    private static byte[]    map2 = new byte[128];
         static {
            for (int i=0; i<map2.length; i++) map2<i> = -1;
            for (int i=0; i<64; i++) map2[map1<i>] = (byte)i; }
    Encodes a string into Base64 format.
    No blanks or line breaks are inserted.
    @param s  a String to be encoded.
    @return   A String with the Base64 encoded data.
    public static String encode (String s) {
         return new String(encode(s.getBytes())); }
    Encodes a byte array into Base64 format.
    No blanks or line breaks are inserted.
    @param in  an array containing the data bytes to be encoded.
    @return    A character array with the Base64 encoded data.
    public static char[] encode (byte[] in) {
         int iLen = in.length;
         int oDataLen = (iLen*4+2)/3;       // output length without padding
         int oLen = ((iLen+2)/3)*4;         // output length including padding
         char[] out = new char[oLen];
         int ip = 0;
         int op = 0;
         while (ip < iLen) {
            int i0 = in[ip++] & 0xff;
            int i1 = ip < iLen ? in[ip++] & 0xff : 0;
            int i2 = ip < iLen ? in[ip++] & 0xff : 0;
            int o0 = i0 >>> 2;
            int o1 = ((i0 &   3) << 4) | (i1 >>> 4);
            int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
            int o3 = i2 & 0x3F;
            out[op++] = map1[o0];
            out[op++] = map1[o1];
            out[op] = op < oDataLen ? map1[o2] : '='; op++;
            out[op] = op < oDataLen ? map1[o3] : '='; op++; }
         return out; }
    Regards
    Sathish Kumar

  • Converting Image.jpg to byte array

    Hi,
    How do i convert a image (in any format like .jpeg, .bmp, gif) into a byte array
    And also vice versa, converting byte array to image format
    Thank you

    how about Class.getResourceAsStream(String name).read(byte[] b)?

  • Help with an Array problem

    How do I get the variable checkNumber to read from the input and exit if the user enters a value less than 0? I initially created the array to accept 10 integer values and then average and sum them using JOptionPane. Now I would like the user to be able to exit the program if a negative value is entered in the input. Here's how it looks so far and I understand the if statement is where I am losing it.
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    import javax.swing.*;
    class originalArray
        public static void main(String args[])
            int checkNumber;
            int inputArray[] = new int[10];
            int arrayLength = inputArray.length;
            Boolean keepRunning = true;
                while (keepRunning)
                for(int i=0;i<arrayLength;i++)
                inputArray=Integer.parseInt(JOptionPane.showInputDialog("Enter integer for array location "+i+" :"));
    //checkNumber = inputArray;
    if (checkNumber <0)
    System.exit(0);
    else
    {int sum = 0;
                String loc = "";
                for(int i=0; i<arrayLength; i++)
                    sum+= inputArray[i];
    loc+= "Array location " + i + " is " + inputArray[i] + "\n";
    double avg;
    NumberFormat formatter = new DecimalFormat ("#0.000");
    avg =(double)sum/10;
    JOptionPane.showMessageDialog (null, loc + "The sum or the array is " + sum + "\n The average of the array is " + formatter.format(avg));

    import javax.swing.*;
    import java.text.*;
    class OriginalArray
        public static void main(String args[])
            int checkNumber=0;
            int inputArray[] = new int[10];
            int arrayLength = inputArray.length;
            Boolean keepRunning = true;
            int sum = 0;
            String loc = "";
             while (keepRunning)
               for(int i=0;i<arrayLength;i++)
                             inputArray=Integer.parseInt(JOptionPane.showInputDialog("Enter integer for array location "+i+" :"));
    checkNumber = inputArray[i];
    if (checkNumber <0)
    System.exit(0);
    else
    continue;
    for(int i=0; i<arrayLength; i++)
    sum+= inputArray[i];
    loc+= "Array location " + i + " is " + inputArray[i] + "\n";
    double avg;
    NumberFormat formatter = new DecimalFormat ("#0.000");
    avg =(double)sum/10;
    JOptionPane.showMessageDialog (null, loc + "The sum or the array is " + sum + "\n The average of the array is " + formatter.format(avg));
    keepRunning=false;
    bye                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Sorting a two-dimensional array to check min and max random results.

    I am working on a new project to learn more advanced uses of java, and have run into some very confusing output. the program should roll 2 6 sided dice 36000 times, storing the results (how many times each of the 21 possible combinations of rolls occurred) in a 2-d array, printing that array in tabular format, then copying the values to a 1d array to sort numericallly (ascending) then print which combination of rolls occured least and most, with how many occurences for each (least and most) here is the code I have, the error will be below it.
    package d12;
    //import classes to use
    import java.util.Random;
    import java.util.Arrays;
    public class randomDice2D {
         * @param args the command line arguments
        public static void main(String[] args) {
    //bring in new Random object
            Random r = new Random();
    //declare all variables and arrays
            int[][] dieResults; dieResults = new int[6][6];
            int[] sortingResults; sortingResults=new int[37];
            int one;  int two;  int three;  int four;  int five;  int six;
            int seven;  int eight;  int nine;  int ten;  int eleven;  int twelve;
            int thirteen;  int fourteen;  int fifteen;  int sixteen;  int seventeen;
            int eighteen;  int nineteen;  int twenty;  int twentyone;
            //initialize all variables at 0
            one=0;  two=0;  three=0;  four=0;  five=0;  six=0;  seven=0;  eight=0;
            nine=0;  ten=0;  eleven=0;  twelve=0;  thirteen=0;  fourteen=0;
            fifteen=0;  sixteen=0;  seventeen=0;  eighteen=0;  nineteen=0;
            twenty=0;  twentyone=0;
    //do dice rolling and count each iteration of each possible result - 36 possible??
            for (int i = 0; i < 36000; i++)
              int roll  = (r.nextInt(6) + 1) ;
              int roll2 = (r.nextInt(6) + 1) ;
            if (roll ==1 && roll2 == 1) ++one;
            if ((roll == 1 && roll2 == 2) || (roll2 == 1 && roll == 2)) ++two;
            if ((roll == 1 && roll2 == 3) || (roll2 == 1 && roll == 3)) ++three;
            if ((roll == 1 && roll2 == 4) || (roll2 == 1 && roll == 4)) ++four;
            if ((roll == 1 && roll2 == 5) || (roll2 == 1 && roll == 5)) ++five;
            if ((roll == 1 && roll2 == 6) || (roll2 == 1 && roll == 6)) ++six;
            if (roll == 2 && roll2 == 2) ++seven;
            if ((roll == 2 && roll2 == 3) || (roll2 == 2 && roll == 3)) ++eight;
            if ((roll == 2 && roll2 == 4) || (roll2 == 2 && roll == 4)) ++nine;
            if ((roll == 2 && roll2 == 5) || (roll2 == 2 && roll == 5)) ++ten;
            if ((roll == 2 && roll2 == 6) || (roll2 == 2 && roll == 6)) ++eleven;
            if ((roll == 3 && roll2 == 3)) ++twelve;
            if ((roll == 3 && roll2 == 4) || (roll2 == 3 && roll == 4)) ++thirteen;
            if ((roll == 3 && roll2 == 5) || (roll2 == 3 && roll == 5)) ++fourteen;
            if ((roll == 3 && roll2 == 6) || (roll2 == 3 && roll == 6)) ++fifteen;
            if (roll == 4 && roll2 == 4) ++sixteen;
            if ((roll == 4 && roll2 == 5) || (roll2 == 4 && roll == 5)) ++seventeen;
            if ((roll == 4 && roll2 == 6) || (roll2 == 4 && roll == 6)) ++eighteen;
            if (roll == 5 && roll2 == 5) ++nineteen;
            if ((roll == 5 && roll2 == 6) || (roll2 == 5 && roll == 6)) ++twenty;
            if (roll == 6 && roll2 == 6) ++twentyone;
            //assign results to array
            dieResults[0][0]=one;
            dieResults[1][0]=two; dieResults[0][1]=two;
            dieResults[2][0]=three;dieResults[0][2]=three;
            dieResults[3][0]=four;dieResults[0][3]=four;
            dieResults[4][0]=five;dieResults[0][4]=five;
            dieResults[5][0]=six;dieResults[0][5]=six;
            dieResults[1][1]=seven;
            dieResults[2][1]=eight;dieResults[1][2]=eight;dieResults[3][1]=nine;
            dieResults[1][3]=nine;dieResults[4][1]=ten;dieResults[1][4]=ten;
            dieResults[5][1]=eleven;dieResults[1][5]=eleven;
            dieResults[2][2]=twelve;
            dieResults[3][2]=thirteen;dieResults[2][3]=thirteen;
            dieResults[4][2]=fourteen;dieResults[2][4]=fourteen;
            dieResults[5][2]=fifteen;dieResults[2][5]=fifteen;
            dieResults[3][3]=sixteen;
            dieResults[4][3]=seventeen;dieResults[3][4]=seventeen;
            dieResults[5][3]=eighteen;dieResults[3][5]=eighteen;
            dieResults[4][4]=nineteen;
            dieResults[5][4]=twenty;dieResults[4][5]=twenty;
            dieResults[5][5]=twentyone;
            //print results
            for (int j=0; j<dieResults.length; j++){
                System.out.print("\n");
                for (int k=0; k<dieResults.length; k++){
                System.out.print("|"+dieResults[j][k]+"| ");
            // Verify program accuracy and ensure total reported results add up to 36000
    System.out.println("\nValidate: 1's; "+dieResults[0][0]+" 1 & 2; "+dieResults[1][0]+
            dieResults[0][1]+" 4's; "+dieResults[2][0]+dieResults[0][2]+" 5's; "
            +dieResults[3][0]+dieResults[0][3]+" 6's; "+dieResults[4][0]+dieResults[0][4]
            +" 7's; "+dieResults[5][0]+dieResults[0][5]);
    System.out.println("All total rolls add up to " + (dieResults[0][0] + dieResults[0][1] +
             dieResults[0][2] + dieResults[0][3] + dieResults[0][4] + dieResults[0][5]));
    //check lowest/highest numbers entered to verify results are reasonable
    //sort results to obtain lowest and highest number of rolls
        for (int l=0; l<sortingResults.length;l++){
         for (int m=0; m<sortingResults.length;m++){
            sortingResults[l]=dieResults[l][m];
    Arrays.sort(sortingResults);
    //determine and print what roll occurred the least
        if (sortingResults[0] == two)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2's with " + sortingResults[0]);
        if (sortingResults[0] == three)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3's with " + sortingResults[0]);
        if (sortingResults[0] == four)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4's with " + sortingResults[0]);
        if (sortingResults[0] == five)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5's with " + sortingResults[0]);
        if (sortingResults[0] == six)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6's with " + sortingResults[0]);
        if (sortingResults[0] == seven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "7's with " + sortingResults[0]);
        if (sortingResults[0] == eight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "8's with " + sortingResults[0]);
        if (sortingResults[0] == nine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "9's with " + sortingResults[0]);
        if (sortingResults[0] == ten)
            System.out.println("The lowest number of rolls for a single result is "
                    + "10's with " + sortingResults[0]);
        if (sortingResults[0] == eleven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "11's with " + sortingResults[0]);
        if (sortingResults[0] == twelve)
            System.out.println("The lowest number of rolls for a single result is "
                    + "12's with " + sortingResults[0]);
    //determine and print what roll occurred the most
        if (dieResults[5][5] == two)
            System.out.println("The highest number of rolls for a single result is "
                    + "2's with " + dieResults[10]);
        if (dieResults[5][5] == three)
            System.out.println("The highest number of rolls for a single result is "
                    + "3's with " + dieResults[10]);
        if (dieResults[5][5] == four)
            System.out.println("The highest number of rolls for a single result is "
                    + "4's with " + dieResults[10]);
        if (dieResults[5][5] == five)
            System.out.println("The highest number of rolls for a single result is "
                    + "5's with " + dieResults[10]);
        if (dieResults[5][5] == six)
            System.out.println("The highest number of rolls for a single result is "
                    + "6's with " + dieResults[10]);
        if (dieResults[5][5] == seven)
            System.out.println("The highest number of rolls for a single result is "
                    + "7's with " + dieResults[10]);
        if (dieResults[5][5] == eight)
            System.out.println("The highest number of rolls for a single result is "
                    + "8's with " + dieResults[10]);
        if (dieResults[5][5] == nine)
            System.out.println("The highest number of rolls for a single result is "
                    + "9's with " + dieResults[10]);
        if (dieResults[5][5] == ten)
            System.out.println("The lohighestwest number of rolls for a single result is "
                    + "10's with " + dieResults[10]);
        if (dieResults[5][5] == eleven)
            System.out.println("The highest number of rolls for a single result is "
                    + "11's with " + dieResults[10]);
        if (dieResults[5][5] == twelve)
            System.out.println("The highest number of rolls for a single result is "
                    + "12's with " + dieResults[10]);
    }the output I got was this:
    run:
    |988| |2038| |1933| |2008| |2095| |2002|
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
    |2038| |965| |1973| |1982| |1985| |2028|
    |1933| |1973| |1034| |1952| |1928| |2055|
    |2008| |1982| |1952| |1010| |1981| |2023|
    |2095| |1985| |1928| |1981| |1041| |1996|
    |2002| |2028| |2055| |2023| |1996| |983| Validate: 1's; 988 1 & 2; 20382038 4's; 19331933 5's; 20082008 6's; 20952095 7's; 20022002
    All total rolls add up to 11064
            at d12.randomDice2D.main(randomDice2D.java:101)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)I can see from the validate line in output that i need to start that line with a \n and change the formula of that println from
    +dieResults[x][y]+dieResults[y][x]+
    to
    +(dieResults[x][y]+dieResults[y][x])+
    I am also aware i have to finish listing all the elements of the array to add to the all total rolls line, but that I can add as I wait for an answer to the errors I don't see the solutions to. The last thing I need help with is how to print those results in a 2-d table format instead of one number per line. Should I change the pair of loops here:
    for (int l=0; l<sortingResults.length;l++){
         for (int m=0; m<sortingResults.length;m++){
            sortingResults[l]=dieResults[l][m];
            }    }to a single loop repeated till the end like this?
    for (int l=0; l<6; l++){
    sortingResults[l]=dieResults[l][0];}
    for (int m=0; m<5; m++){
    sortingResults[(m+6)]=dieResults[m][1];}
    for (int n=0; n<4; n++){
    sortingResults[(n+11)]=dieResults[n][1];}or just take 21 lines (or 36 if i track all results instead of all unique) to declare each element like:
    sortingResults[a]=dieResults[x][y];
    Edited by: Geode on Oct 20, 2010 12:38 AM

    Ok, I have done a lot and thought I had worked out all of the problems. Netbeans had no problems compiling it or running it, and the output was exactly what I expected it to be. Then I decided that the println starting "Validate:" was unneccessary since I printed the table right before it, so I deleted it. Noww Netbeans is telling me it compiles with errors every time i run it, even though it doesn't flag any line as having an error and it still executes exactly as I expect it to. Also, I was not able to find a way to make the three big sets of if's into loops. Any suggestions or ideas on how they could be looped would be most welcome. Also, any ideas on why Netbeans is saying it compiles with errors when it does not give any. I'll give the code and then the output again.
    package d12;
    //import classes to use
    import java.util.Random;
    import java.util.Arrays;
    public class randomDice2D {
         * @param args the command line arguments
        public static void main(String[] args) {
    //bring in new Random object
            Random r = new Random();
    //declare all variables and arrays
            int[][] dieResults; dieResults = new int[6][6];
            int[] sortingResults; sortingResults=new int[36];
            int one; int two; int three; int four; int five; int six; int seven;
            int eight; int nine; int ten; int eleven; int twelve; int thirteen;
            int fourteen; int fifteen; int sixteen; int seventeen; int eighteen;
            int nineteen; int twenty; int twentyone; int twentytwo; int twentythree;
            int twentyfour; int twentyfive; int twentysix; int twentyseven;
            int twentyeight; int twentynine; int thirty; int thirtyone; int thirtytwo;
            int thirtythree; int thirtyfour; int thirtyfive; int thirtysix;
            //initialize all variables at 0
            one=0;two=0;three=0;four=0;five=0;six=0;seven=0;eight=0;nine=0;ten=0;
            eleven=0;twelve=0;thirteen=0;fourteen=0;fifteen=0;sixteen=0;seventeen=0;
            eighteen=0;nineteen=0;twenty=0;twentyone=0;twentytwo=0;twentythree=0;
            twentyfour=0;twentyfive=0;twentysix=0;twentyseven=0;twentyeight=0;
            twentynine=0;thirty=0;thirtyone=0;thirtytwo=0;thirtythree=0;thirtyfour=0;
            thirtyfive=0;thirtysix=0;
    //do dice rolling and count each iteration of each possible result - 36 possible??
            for (int i = 0; i < 36000; i++)
              int roll  = (r.nextInt(6) + 1) ;
              int roll2 = (r.nextInt(6) + 1) ;
            if (roll == 1 && roll2 == 1) ++one;
            if (roll == 1 && roll2 == 2) ++two;
            if (roll == 1 && roll2 == 3) ++three;
            if (roll == 1 && roll2 == 4) ++four;
            if (roll == 1 && roll2 == 5) ++five;
            if (roll == 1 && roll2 == 6) ++six;
            if (roll == 2 && roll2 == 1) ++seven;
            if (roll == 2 && roll2 == 2) ++eight;
            if (roll == 2 && roll2 == 3) ++nine;
            if (roll == 2 && roll2 == 4) ++ten;
            if (roll == 2 && roll2 == 5) ++eleven;
            if (roll == 2 && roll2 == 6) ++twelve;
            if (roll == 3 && roll2 == 1) ++thirteen;
            if (roll == 3 && roll2 == 2) ++fourteen;
            if (roll == 3 && roll2 == 3) ++fifteen;
            if (roll == 3 && roll2 == 4) ++sixteen;
            if (roll == 3 && roll2 == 5) ++seventeen;
            if (roll == 3 && roll2 == 6) ++eighteen;
            if (roll == 4 && roll2 == 1) ++nineteen;
            if (roll == 4 && roll2 == 2) ++twenty;
            if (roll == 4 && roll2 == 3) ++twentyone;
            if (roll == 4 && roll2 == 4) ++twentytwo;
            if (roll == 4 && roll2 == 5) ++twentythree;
            if (roll == 4 && roll2 == 6) ++twentyfour;
            if (roll == 5 && roll2 == 1) ++twentyfive;
            if (roll == 5 && roll2 == 2) ++twentysix;
            if (roll == 5 && roll2 == 3) ++twentyseven;
            if (roll == 5 && roll2 == 4) ++twentyeight;
            if (roll == 5 && roll2 == 5) ++twentynine;
            if (roll == 5 && roll2 == 6) ++thirty;
            if (roll == 6 && roll2 == 1) ++thirtyone;
            if (roll == 6 && roll2 == 2) ++thirtytwo;
            if (roll == 6 && roll2 == 3) ++thirtythree;
            if (roll == 6 && roll2 == 4) ++thirtyfour;
            if (roll == 6 && roll2 == 5) ++thirtyfive;
            if (roll == 6 && roll2 == 6) ++thirtysix;
            //assign results to array
            dieResults[0][0]=one;dieResults[1][0]=seven; dieResults[0][1]=two;
            dieResults[2][0]=thirteen;dieResults[0][2]=three;dieResults[3][0]=nineteen;
            dieResults[0][3]=four;dieResults[4][0]=twentyfive;dieResults[0][4]=five;
            dieResults[5][0]=thirtyone;dieResults[0][5]=six;dieResults[1][1]=eight;
            dieResults[2][1]=fourteen;dieResults[1][2]=nine;dieResults[3][1]=twenty;
            dieResults[1][3]=ten;dieResults[4][1]=twentysix;dieResults[1][4]=eleven;
            dieResults[5][1]=thirtytwo;dieResults[1][5]=twelve;dieResults[2][2]=fifteen;
            dieResults[3][2]=twentyone;dieResults[2][3]=sixteen;dieResults[4][2]=twentyseven;
            dieResults[2][4]=seventeen;dieResults[5][2]=thirtythree;dieResults[2][5]=eighteen;
            dieResults[3][3]=twentytwo;dieResults[4][3]=twentyeight;dieResults[3][4]=twentythree;
            dieResults[5][3]=thirtyfour;dieResults[3][5]=twentyfour;dieResults[4][4]=twentynine;
            dieResults[5][4]=thirtyfive;dieResults[4][5]=thirty;dieResults[5][5]=thirtysix;
            //print results
            System.out.println("     1      2      3      4     5      6");
            for (int j=0; j<dieResults.length; j++){
                System.out.print("\n"+(j+1)+" -");
                for (int k=0; k<dieResults.length; k++){
                System.out.print("|"+dieResults[j][k]+"| ");
            // Verify program accuracy to ensure total results add up to 36000
    System.out.println("\nAll total rolls add up to "+(dieResults[0][0]+dieResults[0][1]+
             dieResults[0][2]+dieResults[0][3]+dieResults[0][4]+dieResults[0][5]+
             dieResults[1][0]+dieResults[1][1]+dieResults[1][2]+dieResults[1][3]+
             dieResults[1][4]+dieResults[1][5]+dieResults[2][0]+dieResults[2][1]+
             dieResults[2][2]+dieResults[2][3]+dieResults[2][4]+dieResults[2][5]+
             dieResults[3][0]+dieResults[3][1]+dieResults[3][2]+dieResults[3][3]+
             dieResults[3][4]+dieResults[3][5]+dieResults[4][0]+dieResults[4][1]+
             dieResults[4][2]+dieResults[4][3]+dieResults[4][4]+dieResults[4][5]+
             dieResults[5][0]+dieResults[5][1]+dieResults[5][2]+dieResults[5][3]+
             dieResults[5][4]+dieResults[5][5]));
    //check lowest/highest numbers entered to verify results are reasonable
    //sort results to obtain lowest and highest number of rolls 
    int z;z=0;
    while (z < 36){
    for (int l=0; l<6;l++){
         for (int m=0; m<6;m++){
            sortingResults[z]=dieResults[l][m];++z;
    Arrays.sort(sortingResults);
    //determine and print what roll occurred the least
        if (sortingResults[0] == one)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1's with " + sortingResults[0]);
        if (sortingResults[0] == two)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == three)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == four)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == five)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == six)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == seven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == eight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == nine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == ten)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == eleven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == twelve)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == thirteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == fourteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == fifteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == sixteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == seventeen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == eighteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == nineteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == twenty)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == twentyone)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == twentytwo)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == twentythree)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == twentyfour)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == twentyfive)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == twentysix)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == twentyseven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == twentyeight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == twentynine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == thirty)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyone)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == thirtytwo)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == thirtythree)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyfour)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyfive)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == thirtysix)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 6 with " + sortingResults[0]);
    //determine and print what roll occurred the most
        if (sortingResults[35] == one)
            System.out.println("The highest number of rolls for a single result is "
                    + "1's with " + sortingResults[35]);
        if (sortingResults[35] == two)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == three)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == four)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == five)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == six)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == seven)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == eight)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == nine)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == ten)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == eleven)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == twelve)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == thirteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == fourteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == fifteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == sixteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == seventeen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == eighteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == nineteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == twenty)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == twentyone)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == twentytwo)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == twentythree)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == twentyfour)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == twentyfive)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == twentysix)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == twentyseven)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == twentyeight)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == twentynine)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == thirty)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyone)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == thirtytwo)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == thirtythree)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyfour)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyfive)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == thirtysix)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 6 with " + sortingResults[35]);
    }and here is the output (after clicking 'Run Anyways' on the project compiled with errors message from Netbeans)
    run:
         1      2      3      4     5      6
    1 -|995| |1014| |1076| |976| |1015| |1000|
    2 -|971| |982| |993| |1067| |983| |1011|
    3 -|990| |951| |1019| |968| |1011| |1023|
    4 -|999| |931| |1009| |987| |1020| |1022|
    5 -|969| |954| |997| |970| |1016| |1028|
    6 -|955| |1014| |996| |996| |1075| |1017|
    All total rolls add up to 36000
    The lowest number of rolls for a single result is 4 & 2 with 931
    The highest number of rolls for a single result is 1 & 3 with 1076
    BUILD SUCCESSFUL (total time: 13 seconds)

  • How to insert an array of number into access database?

    How can I insert an array of numbers(double) into an access database and later read them back to an array I labview. I don't have the Database Connectivity toolset. I would prefer using the LABSQL or other free solution. Any idea on how to solve this. I have tried LABSQL and SQL commands, but when I do that I have to convert the number to a string and then make a SQL-command string. Is there a way where I don't have to convert the number into a string?

    Hello,
    I am not familiar with LABSQL and we do not do any support on that particular product. However I still want to give you some information on how to proceed. You can either store the array to binary format and by doing this you can save an entire array to one single element of the database. The other alternative is of course to save one-to-one in other words one element of the array in one element in the database.
    More info can be found here:
    http://digital.ni.com/public.nsf/websearch/3FE68BBDA95E845986256DB4006A22C0?OpenDocument
    Have you checked MSDN for information regarding this? You might be able to find useful SQL code there to use.
    Regards,
    Jimmie A.
    Applications Engineer, National Instruments
    Regards,
    Jimmie Adolph
    Systems Engineer Manager, National Instruments Northern Region
    Bring Me The Horizon - Sempiternal

Maybe you are looking for