From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a missing character value

I am reading from text files and have blank cells in data sets which I would like to keep blank rather then labview intuitively reading them as zeros. Is there a way to add a character for labview to read over that particular cell?
0 Kudos
Message 1 of 4
(2,408 Views)
You need to provide some more info on exactly how you are reading the text file. Are you converting the text to a number? What's the final destination of the text file data - array of numerics? Post an example of what you're doing if you can.

Tim
0 Kudos
Message 2 of 4
(2,408 Views)
i have the same problem with missing values known as zeros. my txt file is read by sub-vi "read characters from file" then with "spreadsheet string to array" i convert it in numerical array. then missing values are coded like zeros.
How doing ?
Thanx
Matt
0 Kudos
Message 3 of 4
(2,408 Views)
There's a couple things you might try. Before you do the Spreadsheet String to Array, if your spreadsheet string is something like 1.1,,2.3, then you could do a search and replace of ,, and stick in some number you wouldn't normally see or NaN (Not a Number). You could also first create a string array with Spreadsheet String to Array and search the array for an empty string and replace those values before doing the conversion to a numeric array.
0 Kudos
Message 4 of 4
(2,408 Views)