06-08-2020 09:42 AM - edited 06-08-2020 09:58 AM
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.
Solved! Go to Solution.
06-08-2020 09:47 AM
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.
06-08-2020 09:56 AM - edited 06-08-2020 10:03 AM
Thank You. I just added a trim white space and it worked.
06-08-2020 10:04 AM
@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.