Help! Inserting a 1-D comment array into a 2-D string array at specified row AND column

Hello everyone,
I am writing a 2-D string array to excel and i need a way to add comments to my file like this:  
SLAM    NAME    G Level    Comments
1              RALF         26               
1              RALF         26
1              RALF         26
1              RALF         26
For some reason, i cannot specify a row AND column to write because: 
When i use replace array subset it only replaces 1 element at my index. 
When i use replace array subset with a loop, it creates empty spaces until it reaches the end of the array it is replacing.
When i use Insert into array: i cannot wire 2 inputs for row and column.  
In my complete VI i will need to write from row 1-1001, a different comment from 2-2002, a different comment from 3-3003, etc until a stop condition is met so i need to figure out how to do this programatically and not have it replace any elements outside of the range or it will override previous commetns. 
I am at a loss of what to do. Any and all suggestions are greatly appreciated. 
Thanks!
Solved!
Go to Solution.
Attachments:
array.vi ‏13 KB

Hi proph,
I made a small subtile change to yur VI and now it replaces all values of the 4th column…
THINK DATAFLOW!
Use shift registers when you need to propagate values from one loop iteration to the next!
USE/LEARN DEBUGGING TECHNIQUES!
There are tools like probes and highlight to understand your VI execution and to find problems…
Go through all those free online courses offered by NI!
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
array.vit ‏12 KB

Similar Messages

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • Get the intersection when u know row and column in 2D array

    I am trying to get the intersection of the row and column and I am not able to do so......
    for example:
    123456789 <<These in array indicate the row
    255555555
    388888888
    499997999
    1234 above first element of each row represent columns........
    I want to get 7 which is the intersection of column 6 and row 4............Please help

    Hi Marlin..
    I am reading this after having done it in a very similar way....... thank you so much
    The problem is that the letters in languages can also be characters so they can be a,b..Language over{a,b}..if characters are not in numbers I am trying convert a,b into int internally however I dont know any data structure in java which will accept character as key and int as value......
    So I am stuck at modifying the part highlighted with ???? below
         public void startRecognizing()
              System.out.println("Begun recognizing language....");
              //Convert the word entered to letter array
              char [] wordEntered = word.toCharArray();
              // initialize variables
              currentState = startState[0]; //In the beginning the current state is start state
              /***************    For each letter entered    ********************************/
                   for (int w =0; w < wordEntered.length ;w++)
                        //Print element entered
                        currentChar = wordEntered[w];
                        System.out.println("Char "+currentChar);
                        //Convert to int
                        int currentIntChar;
                        //System.out.println("Char "+currentIntChar);
                        //Print current state
                   int currentIntState = Character.getNumericValue(currentState);
                        //System.out.println(" State "+currentIntState);
                        System.out.println(" State "+currentState);
                   // if characters are numbers this is fine below
                   if((Character.getNumericValue(currentChar)) != -1)
                                          currentIntChar = Character.getNumericValue(currentChar);
    /*** Get the new state based on element entered with the current state and get a new state***/ // column/char entered & row/state// The intersection is the new state which is made the current state for further process
                        //We add 1 since array starts from 0
                   currentState = transitionTable[currentIntState+1][currentIntChar+1];
                        System.out.println("  NEW current state "+currentState);
                   else
         //if letters in the language are not in numbers and are char ie a,b then convert a,b into int internally
                        java.util.Hashtable h = new java.util.Hashtable();
                        // STUCK HERE !!******************??????????
                        h.put(wordEntered[w], new Integer(w));
                        currentIntChar = ((Integer)h.get(wordEntered[w])).intValue();
              System.out.println("currentIntChar non numbers "+currentIntChar);
                        //We add 1 since array starts from 0
                   currentState = transitionTable[currentIntState+1][currentIntChar+1];
                        System.out.println("  NEW current state "+currentState);
              }//for main          
              finalDecision();
         }//startRecognizingThe assignment is due tomm morning...... I havent slept all night !

  • I need to take elements from within 2 nested for loops and place them in an array at the specific row and column that I need.

    I have tried intializing an array and replacing elements by specifying a particular row, and column, but in the end I get an array with only one element replaced, and I suspect that it is because as the for loops are running through their iterations each time the array is re-initializing. I have a simple vi that I will post below, it is not the exact situation that I have but is a good place for me to get some understanding. I have the row and column indexes being driven by the inner and outer loop iterations, which gives me the pattern I need. I am using the inner iterations as array elements. How do I set this up so that it works and d
    oes keep re-initializing my array.
    Attachments:
    Untitled.vi ‏26 KB

    I have fixed a number of things in your vi.
    You were right in thinking that the array was continuously re-initialized. To avoid this, use a shift register (right-click the loop border), which will pass the updated array into the next iteration.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    your_vi.vi.zip ‏13 KB

  • Arrays[][] - row and column

    Evening All...
    Just a quick question regarding arrays. My program is working but I am trying to tidy it up.
    public class Arrays{
    static int firstArray[][]= new int [][] {{8,5},{9,3}};
    static int secondArray[][]= new int [][] {{1,7},{4,8}};
    static int thirdArray[][]= new int [][] {{0,2,4},{9,6,8}};
         static int fourthArray[][]= new int [][] {{2,1,0},{6,2,3}};
    public static void main(String[] args)
         multiply(secondArray,firstArray);
         multiply(firstArray,thirdArray);
         public static void multiply( int[][] x, int[][] z)
         int array2[][] = new int [3][3];
         int 1r = x.length;
         int 1c = x[0].length;
         int 2r = z.length;
         int 2c = z[0].length;
         //for(etc...)
    //      (Rest of program)
    I want to edit the array.--------int array2[] = new int[3][3]; (up 9 lines)
    Instead of specifying it as [3][3] for size.
    I would like to say new int - length of row and column - im pretty sure it is similar to
    the ints below - but cant seem to get the correct combination.
    Thanks in advance for any help folks.

    - you can use variables to specify array dimensions
    - you can get the (1D) dimension of an array by using the "attribute" theArray.length . Knowing that a 2D-array is indeed an array of arrays, you can indirectky get the size oif the second dimension too:
    public static void multiply( int[][] x, int[][] z) 
    int array2[][] = new int [x.length][x[0].length];                  
    }Of course this shoud be robustified to protect against x or x[0] being null (but in this case the multiplication is probably doomed anyway).
    Regards,
    J
    Edited by: jduprez on Mar 14, 2011 10:45 PM
    And please, in the future, use tags around code text, when posting code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Summing the Rows and Columns in an Array

    I am importing a 2-dimensional array of integers.(which is held in a 2-dimensional array)
    I need to store the row sums and column sums in separate 1-dimensional arrays.
    I can get the integers in and print out a list along with the grand total(sum of all).
    But, how do I pass each row's and each column's value in to my sumRow and sumCol methods to get the sum for each row and each column?
    Can I do the row and column summing in the same "for" statement where I calculate the "grand total"? Or am I making this more difficult than it is?
    Would appreciate any help.
    This is what I have so far:
    import java.awt.Graphics;
    import java.applet.Applet;
    public class TwoWayTable extends Applet {
         int numRows;
         int numCols;
         int [] [] cell;
         int [] rowSum;
         int [] colSum;
         int grandTotal;
    public TwoWayTable(int [][] data){
    grandTotal = 0;
    cell = new int [data.length][data.length];
    for(int i = 0; i < data.length; i++)
    for(int j = 0; j < data.length; j++){
         cell[i][j] = data[i][j];
    grandTotal += cell[i][j];
         System.out.println(cell[i][j]);
    System.out.println(grandTotal);
    public int sumRow(int [] data2){
         int rowaccumulator=0;
         rowSum = new int[data2.length];
         for(int numRows = 0; numRows < rowSum.length; numRows++){
         rowaccumulator += rowaccumulator + rowSum[numRows];
              return(rowaccumulator);
    public int sumCol(int [] data3){
         int colaccumulator = 0;
         colSum = new int[data3.length];
         for(int numCols = 0; numCols < colSum.length; numCols++){
              colaccumulator += colaccumulator + colSum[numCols];
              return(colaccumulator);

    Thanks for your input.
    I'll make the changes that you suggest.(after this)
    My output prints:
    4 6 3 8 21
    9 1 5 3 18
    13 7 8 11 39
    numbers are right, but I need to format the table
    the output needs to look like this:
    int int int int | rowsum
    int int int int | rowsum
    colsum colsum colsum colsum | total
    How do I do this?
    I have no idea?
    I'm supposed to call a "void setMargins( )" method to line this up, without
    using the exotic formatting in the IO library.
    I'm also supposed to use "public String toString( )"
    This is what I have so far:
    import java.awt.Graphics;
    import java.applet.Applet;
    public class TwoWayTable extends Applet {
    int numRows;
         int numCols;
         int [] [] cell;
         int [] rowSum;
         int [] colSum;
         int grandTotal;
    public TwoWayTable(int [][] data){
    cell = new int [data.length][data.length];     
    for(int i = 0; i < data.length; i++){
    for(int j = 0; j < data.length; j++){
         cell[i][j] = data[i][j];
    calcTotals(cell);
    for(int i = 0; i < cell.length; ++i){
    for(int j = 0; j < cell.length; ++j){
    System.out.print(cell[i][j] + " ");
    System.out.println(rowSum[i] + " ");
    for(int j = 0; j < cell.length-1; ++j){
    System.out.print(colSum[j] + " ");
    System.out.println(colSum[cell.length-1] + " " + (grandTotal));
         public void calcTotals(int [][] data2){
              grandTotal = 0;
              rowSum = new int[data2.length];                         
              colSum = new int[data2.length];                         
              for(int numRows = 0; numRows < data2.length; numRows++){
              for(int numCols = 0; numCols < data2.length; numCols++){
                   grandTotal += data2[numRows][numCols];               
                   rowSum[numRows] += data2[numRows][numCols];
                   colSum[numCols] += data2[numRows][numCols];

  • In BlackBerry Passport excel can a row and column be inserted?

    Do confirm if in BlackBerry Passport excel row and column can be insert.
    Carlos D'Souza

    You already asked this in another thread.  You can't add a row or column in Sheet to Go.  Sorry.
    1. Please thank those who help you by clicking the "Like" button at the bottom of the post that helped you.
    2. If your issue has been solved, please resolve it by marking the post "Solution?" which solved it for you!

  • How to get number of rows and columns in a two dimensional array ?

    Hello,
    What would be the simplest way to get number of rows and columns in a two dimensional array represented as integers ?
    I'm looking for another solution as For...Each loop in case of large arrays.
    Regards,
    Petri

    Hi Petri,
    See a attached txt file for obtaining two arrays with upper and lower index values
    Regards
    Ray
    Regards
    Ray Farmer
    Attachments:
    Get2DArrayIndex.txt ‏2 KB

  • How Calculate more than one value and store it into to different rows and column for each input?

    thx guys.....i have a progress now in LV
    But now i have new trouble here. Ok i attached my LV file (LV 7.0.1/7.1) and excel form. I just could'nt calculate more than one input value. I want a different result for each value that i enter ... and store it into different rows and column. But it just store at one row.
    Attachments:
    My Project.vi ‏31 KB
    rumus motor bakar.xls ‏14 KB

    duplicate post

  • Row and Column detection of a 2D boolean array

    I use an array as showed by my example (LB8.2).
    Press a 1 or 0 in the array changes it's value and it gives
    back the Row and Column (that was changed).
    I use this to program a 22 channel patterngenerator (GPIB).
    It sends only the column (channel of patterngenerator) patterns, so that makes it faster.
    Has someone an idea if this row and column detection can be made simpler (faster)?
    Kind regards, Bernard
    Attachments:
    MyRowColDetection.vi ‏30 KB

    Here is a different way
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    MyRowColDetection Rev TLE.vi ‏15 KB

  • Get Row and Column info from an Array Cluster

    I have an array with a cluster of 2 elements (string and double). Within my application, I am using the State Machine architecture with an Event Structure. When I click on a element within the cluster array, is there a way to retrieve the row and column? I seen the Coordinates within the Mouse Down event but I don't think that will work.
    Any ideas?
    Solved!
    Go to Solution.

    How To Return the Index of a Mouse-Select Array Element:
    https://decibel.ni.com/content/docs/DOC-6406
    Jean-Marc
    LV2009 and LV2013
    Free PDF Report with iTextSharp

  • Getting row and column of an array element

    Hi,
    I have an array of 24 rows and 24 column giving me a total of 576 elements. How do I get the row and column of a particular element in an array in LabView. E.g. If I have to write to element 127 how do I get the column and row in which element 127 is located.
    Regards,
    Harshil
    Solved!
    Go to Solution.

    Hi Harshil,
    maybe you only need to find the correct "address" of the element in your 2D array?
    Use something like this:
    Maybe you have to switch Row&Column output according to your numbering scheme...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Remove specific row and column from 2d array

    Hi,
    I would like to know how to remove the specific row and column from 2d array.
    for example, I have the original 4x4 array as below
    2 -1 -1 0
    -1 2 0 -1
    -1 -1 2 0
    -1 -1 -1 3
    let say that i want to remove row 2(bold) and column 2(bold), and the new 2d array should get as below
    2 -1 0
    -1 2 -1
    -1 -1 3
    Thanks.

    You can't remove elements of an array, it's fixed at a certain size once created. What you can do however is make a new array and only copy the things you want. Something like:public static void main(String[] args) {
        Integer[][] bar = new Integer[5][5];
        for (int i = 0; i < bar.length; i++) {
            Integer[] baz = bar;
    Arrays.fill(baz, i);
    System.out.println(Arrays.toString(baz));
    Integer[][] muu = new Integer[5][4];
    removeColumn(3, bar, muu);
    for (Integer[] mee : muu) {
    System.out.println(Arrays.toString(mee));
    Integer[][] smuu = new Integer[4][5];
    removeRow(3, bar, smuu);
    for (Integer[] mee : smuu) {
    System.out.println(Arrays.toString(mee));
    public static <T> void removeRow(int row, T[][] a, T[][] result) {
    if (row >= a.length) {
    throw new IllegalArgumentException("no row at " + row);
    for (int a_r = 0, result_r = 0; a_r < a.length; a_r++) {
    if (a_r == row) {
    continue;
    System.arraycopy(a[a_r], 0, result[result_r], 0, a[a_r].length);
    result_r++;
    public static <T> void removeColumn(int col, T[][] a, T[][] result) {
    for (int i = 0; i < a.length; i++) {
    if (col >= a[i].length) {
    throw new IllegalArgumentException("no column at [" + i + ", " + col + "]");
    for (int a_i = 0, r_i = 0; a_i < a[i].length; a_i++) {
    if (a_i == col) {
    continue;
    result[i][r_i] = a[i][a_i];
    r_i++;

  • How to determine rows and columns of a two dimensional array at runtime?

    Dear All,
    I am using Java 5.
    I have defined an array as follows:
    int[][] arr= { {1,2,3}, {4,5,6}};
    Using the reference of arr, how can i get the rows (2) and columns (3) of this array at run-time?
    Thanks in advance.
    -Sameer

    rows and columns are simply the way you visualize the array.
    int[][] arr= { {1,2,3}, {4,5,6}};
    in above code
    if you access array element as arr[x][y]
    then x can have 0 or 1 where y can have 0,1 or 2
    */

  • Rows and Columns Help

    Previously in AI9 when I wanted to modify a matrix I had created using Rows and Columns, I would select the cells of the matrix and then click on Rows and Columns.  Now I have CS4 and the documentation says I should be able to do the same thing using Area Type Options.  However, when I select the cells of a matrix that I created in AI9, Area Type Options is ghosted out.  How do I modify this matrix?

    I would copy and paste in front before I try this.
    Then select the text that is place the text cursor in a the text frame you want to split or select it with a selection tool.
    then see if the Type>Area Text Options are available. They should be.
    If not that means they are object paths not Area Text.
    Click the Frame with the Area Text tool to make it a Area Text Frame now the options should be available.
    The way to tell if these are object paths is to select one and go to the Object >Path>Split into Grid and if that is available then it is an object path.
    The text engine and this feature has changed in AI CS1 and that is probably the cause for the translation to get a bit messed up.

Maybe you are looking for

  • HP deskjet 3050A scan utility won't open with Mac OS 10.8.2

    I downloaded the new software for the HP deskjet printer. Set it up to print wirelessly, which works fine. But the HPScan utility (I seem to have one that says HP Scan and one that says HPScan 3) neither utility can be opened. Message says "check wit

  • Creating Selection Screen version in Logical Database

    Hi, I want to design my own Selection screen while creating a report with Logical Database. My requirement is not to show the Standard Selection screen of LDB. Can it be achieved by creating Selection Screen Version in SE36 and using that version in

  • Neospeech only generates 1 sec audio in Captivate 6? Error

    I am new to Text to Speech in Captivate but am dabbling. I have installed the NeoSpeech content and have selected Paul as the voice I want to use. I generate audio and then preview it and it only creates 1 second worth of audio. If I change the voice

  • Need Clarification on how to provide SRV record for Director pool in Lync 2013 environment

    Hi ,      I am Deploying an Lync Enterprise edition server with high redundancy, I have already deployed the below servers, fepool1.xxx.com, fepool2.xx.com, Exum.xx.com, RootAD.xx.com, CA.xx.com, Sql01.xxx.com, Sql02.xxx.com.  I have already deployed

  • COM Errors

    I am getting the following error over a period of time. DB errors Microsoft][ODBC driver for Oracle][Oracle]ORA-01722 Multiple-step operation generated errors. Check each status value. Any clue as too what maybe causing these errors