LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ignoring a line of data from a text file

I am using a GPS unit to receive latitude and
longitude. This indicates my current position. This data is then saved into a text file. When the GPS signal is not present, the text file would not be able to receive latitude or longitude values, and would consist of incorrect values. As I plot out the graphs
using the information in the text file, the plot would be wrong as the incorrect data corrupts the plot.

Thus, I was wondering whether it is possible to IGNORE these incorrect data in the text file. I have tried using "empty string" and an empty "String Constant" to ignore specific incorrect lines of my text file, but to no avail, as the LabVIEW program seems to plot (0,0) when I use these two aforesaid
functions. Effectively, what
I intend to achieve is to blank out the lines for which there are no GPS signals. The data then would be perfect, and I would not have to manually delete the corrupted lines of text to get a perfect graph, which I'm currently doing now.


Thanking you in advance,

Choy
0 Kudos
Message 1 of 3
(2,978 Views)
If you know which data is corrupted, just don't wire it to the graph, if you don't know or don't want to avoid any point, you can use NaN value, that won't be plotted.
Hope this helps
0 Kudos
Message 2 of 3
(2,978 Views)
Hi Choy,
if you can't filter-out the wrong data during acquisition from the GPS then you have to do off-line filtering on the saved data:
in your question it seems that you have a multi-line string, each line contains one reading. In this case you can convert it in a 2D array of strings using the Speadsheet String to Array function and discard each meaningless array line.
I attach a simple example in which the wrong data are '?'.
Good luck,
Alberto
Message 3 of 3
(2,978 Views)