LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

table problem

I have one problem with table. I am reading one file in while loop which contains spreadsheet lines, so i want to store each line in different row into table. But every time it is overlaping on the same row. How can i avoid this.
0 Kudos
Message 1 of 4
(2,843 Views)
A table is simply a 2D array of strings. Therefore in order to add another row to your table you will need to use the Array manipulation VIs to construct a 2D array. From your description, it sounds as if you are simply passing the new data directly to the table.

To properly construct the table, simply read the current contents of the table and use the Build Array function to append your new data to the array.

Jeremy
0 Kudos
Message 2 of 4
(2,843 Views)
I am doing axactly what you are saying. but i am getting only one row in the table.see my attachement and and send me solution for this.
Disprition: I have to remove some lines from input and then i have store each and evey line in diffrent row in the table.
Download All
0 Kudos
Message 3 of 4
(2,843 Views)
I'm sorry my reply didn't fully answer you question - the additional information you have provided helps better explain exactly what you are trying to do. It's difficult to give a complete answer if you not all the facts are available.

OK so you need to remove the first lines of text from the file - assuming that the lines of text are terminated with CR/LF, I would suggest using Read Lines from File to specifically read back only the part of the file that you require i.e. the main table. Further information can be found in this thread within Developer Zone:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=50650000000800000023300000&ECategory=LabVIEW.LabVIEW+General

Once you have this data the next problem to face is the fact that you have hex and decimal data values within the table. You cannot use Spreadsheet string to Array for the entire table as this would produce invalid result - this VI does allow you to specify different data formats (e.g. decimal and hexidecimal) for different columns.

However you could use the VI twice to convert the hex columns and then the decimal columns. The steps I would take would be as follows:

1. Use Spreadsheet String to Array with format set for hex. From the output array use the Array subset VI to return the two columns containing the hex values. Then use the Cast VI to convert this 2D array of hex numbers to a 2D array of strings - you cannot use the number to string conversion functions - see KB article:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/3dbe89eafe1629c7862569ea00826e03?OpenDocument

2. Use Spreadsheet String to Array with the orginal data array and set the format to decimal. Again use the Array Subset VIs to return the columns of interest and this time use the Number to String VIs to convert this 2D array of numbers to a 2D array of strings.

3. Use the Build Array function to rebuild the 2D array of strings and display the results in a table indicator

Jeremy
0 Kudos
Message 4 of 4
(2,843 Views)