11-29-2014 10:16 AM
Using "write to spreadsheet file" function to write 2D array, I always have the problem that headers cannot align well wiith the data. See attached snapshot please (There are 7 column headers.)
WT
LV2013sp1
Solved! Go to Solution.
11-29-2014 10:34 AM
The default field delimiter is a tab. The data values in the second and third columns appear to have more characters than the default spacing of a tab. This results in the tabs between those columns occuring farther to the right than in the header. I suspect that if you read the file as text and display it with '\' Codes display mode on a string indicator, you will find the same number of tabs (delimiters) in the header row as in the data rows. The data has 12 or 13 characters as formatted (or fewer where trailing zeros are suppressed).
Format the data as fixed field widths. You cannot do this with Write to Spreadsheet File.vi. You will need to use string functions to perform the conversions and formatting and then use Write to Text File.vi.
Or change the tab spacing in the program you are using to display the results. If the tabs were about 15-18 spaces apart, you wuold not see the problem.
Lynn
11-29-2014 11:41 AM - edited 11-29-2014 11:32 PM
Plain text display cannot handle tabs very well.
You can take the spreadsheet file and open it in e.g. excel and it will all look great. Spreadsheet files have no formatting information, just row and column delimiters.
If you want to create nicely formatted report files in LabVIEW, use the report generation tools and pick an output file format that is suitable for what you want to display (e.g. html).
If you want to display your data in a plain text indicator, you would need to do two things:
For a tabular front panel indicator, you should use a table. You can write the header strings into the table header.
11-29-2014 07:23 PM
Thanks to both of you.
WT
LV2013sp1
12-07-2016 02:38 AM
Hello Lynn,
I have met the same problem, do you know how to change the tab spacing?
Best Regard
12-07-2016 02:44 AM
12-07-2016 09:42 AM
@TUDarmstadtLLX wrote:
Hello Lynn,
I have met the same problem, do you know how to change the tab spacing?
Best Regard
Don't start futzing with your text editor.
Use a spreadsheet program to view the files, like MS Office Excel ($$$) or Open Office Calc (free).
Spreadsheet programs will import a Tab or Comma deliminated text file and put all the data in nice neat columns for you.
12-07-2016 09:46 AM