03-21-2014 04:57 PM
hi all
i ve been trying to read a TXT file into labview, the thing is that i have not been able to give format as excel file, i want to use a 2D array for all the data that comes on the txt file
i used the "read from spread sheet" function, the data is read only on one column.then i used the read from text file function, and everything comes on one string indicator
here is the txt file i want to excel format.
hope you can help me
thanks
Solved! Go to Solution.
03-21-2014 05:06 PM
Look at the structure of the text file. The data is separated by spaces. The header looks like it's separated by tabs, but it's not. The column headers are actually separated by several spaces.
Deal with that and you will be just fine.
03-21-2014 05:15 PM
Please post the code that you've tried.
The problem you're having is that the text is delimited with spaces not tabs. The first row has several spaces in between each entry but the rest of the rows have only one space between entries. If you use a space as a delimiter the you'll end up with too many columns and the column headings will be misaligned.
03-21-2014 05:24 PM
Your file has data separated by space and lines separated by line feeds. The complication is that the header line has multiple spaces between data elements.
There are many ways to decode such a string. Here is one. This is not optimized but is intended to show how several of the string functions can be combined to parse your data.
Lynn
03-25-2014 08:57 AM
thanks, this looks fine, now i can manage the data easily
thanks all for your support