LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing colums and reading columns

when i am writing values in the controls (VI attached).in the column headers i write deliberately
CYCLES header after giving space after TIME header.this is because when i see the corresponding text file in notepad.the headers looks fine but in the Table CYCLE header look moved to other column.in
the wordpad all headers looked moved. why it is like this? why cannot same time in table, notepad and wordpad i dont see the header on its appropriate column.
The other issue is when i am reading the same text file that i already wrote.i am getting zeros in first row,first column and last column. i am just deleting the first row and first column.i am also deleting the last column zeros. but i am not sure whether this meth
od of just deleting zeros is correct or wrong.whether i am deleting some important data or not?(VI attached).
Thanks for your help
Download All
0 Kudos
Message 1 of 3
(2,765 Views)
You won't ever get the same look in notepad or wordpad that you would see in a table. The table automatically lines up the data in rows and columns. In notepad or wordpad, all it sees is data, space, data, space, etc. There is no mechanism to line up into columns. You could force the line up if you inserted a tab character between each data value. then you would have data, tab, data, tab,... Notepad would see the tab and move to the next tab mark, thereby lining up the columns. However, if one of the data fields or headers have more characters than the next tab mark, a misalignment could take place. If you want to see things lined up, use a spreadsheet instead of notepad.
On your second issue, the first column (column 0) and first row (row 0) are he
ader information, like "Block 1" and "Amplitude". When reading the file, these values cannot be converted to a number, so you will see a 0 in all columns of the first row and all rows of the first column. When you delete the first row and first column, you are eliminating the headers and get the correct data. Column 6 has zeros because there is no data in column 6. There is a column 6 becasue you wrote the file with a space before CYCLE. This created a column header with no data in that column. Your data for Cycle fell under the column with a space for a header. You do not need that space before CYCLE. Take it out. (Don't worry about it not lining up in a text file, it won't) Then you won't need to delete column 6 because there won't be any column 6. After deleting column 0 (Block#), you will be left with columns 1 through 6 shifting to occupy columns 0 through 5 to fill in for the deleted column.
- tbob

Inventor of the WORM Global
Message 2 of 3
(2,765 Views)
Thanks Tbob i understand it now.
0 Kudos
Message 3 of 3
(2,765 Views)