LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

find blanks in spreasheet

Solved!
Go to solution

Hi There,

 

In my labview program i am analyzing a spreadsheet. I am wondering, is there a way to find blank cell in spreadsheet and fill it with some number like 0 or 1.

 

Thanks

yogesh 

0 Kudos
Message 1 of 5
(3,125 Views)

If the spreadsheet was tab deliniated, you could write a program that reads the text, and searches and replaces two consecutive tab delimiters with what you wanted. Search and replace "\t\t" with "\t0\t"

 

To catch every case (blank cells at the beginning and ends of rows) you would want to do the same with \r\t and \t\r where \r is the return carrage character (dont remember exactly what that is at the moment)

 

This method would be reading from the file with the "read from text file" vi not the read from spreadsheet.vi by the way 

Message Edited by rex1030 on 08-24-2009 04:23 PM
---------------------------------
[will work for kudos]
0 Kudos
Message 2 of 5
(3,122 Views)

I am trying this. But "search and replace substring" function is replacing every cell value to zero. Is there a better way to do this?

 

Thanks

Yogesh 

0 Kudos
Message 3 of 5
(3,104 Views)
Solution
Accepted by topic author Yogesh9ic

Never mind. Replacing it with "search and replace pattern" did the trick.

 

Thanks

Yogesh 

0 Kudos
Message 4 of 5
(3,095 Views)

Many issues here,  two jump off the page.  First, since your spreadsheet is already in the form of a numeric array, you have lost information about the location of blanks.  The 2D array will be padded with zeros, probably in ways you would not like.  Second, searching for an empty string will always produce a hit and will end up with your blank value being inserted to the beginning of the string.  You will never receive an empty string from the number to string conversion.

 

As the previous poster alluded to, you should probably go back to the text version of the spreadsheet and look for doubled up delimiters.

 

 

Having seen your "solution" I will comment that switching to that VI just means that you no longer get a hit with the empty string, and it basically is doing nothing.

 

If you consider zeros to be blanks (not usually a good idea IMO), then you should change your search string to 0.00000

0 Kudos
Message 5 of 5
(3,086 Views)