LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Values not equal

Solved!
Go to solution

Hi,

 

I have created a CSV file to which I strored some string values using a labview program which creates the csv file and adds the data. Then I created a second labview program which reads from this csv file and compare it with another string constant to check if both are equal. For eg: there is a value in the CSV value which is c. Now I compare this c with another string constant which also has the value c. But when I compare them both they are not equal. I checked the string length of both c. String constant c has a string length of 1 as expected since it has only 1 character. But the c from CSV file is showing a string length of 2. Why is the string length of the value read from the .csv file one more than the actual length? How can I correct this. Kindly help me. 

0 Kudos
Message 1 of 4
(2,986 Views)
Solution
Accepted by topic author govindsankar

I suspect you have to program it so that either you eliminate the space (or whatever) that is being added to in one place, or add a space (or whatever) to to the other.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 4
(2,975 Views)

Thank You. I just added a trim white space and it worked. 

Message 3 of 4
(2,964 Views)

@govindsankar wrote:

I just checked by adding a space constant to the string constant and is still showing not equal. I guess it is not space constant. Why is the string length of the value read from the .csv file one more than the actual length. 


Most likely because that's the way you programmed it.  Do you get where I'm coming from, yet?  If not, here's a little hint:

We have no idea what you are talking about yet because we don't have examples of the two files and we don't have any idea of what the code looks like to produce either of the files.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(2,952 Views)