Having issues with (compare text)

When comparing two text strings I should get a match, for some reason its not matching.
Instead of looking around testing I sequentially loaded and displayed values from the list.
Label5 in (else) verifies the value comparing is correct

thanks
Thomas

pls show us relevant blocks....

it seems it doesnt go loop.. i mean increment.. index pointer may return with last value(max of 5ht place) so the compare block may test with,i hope with, pointer at 5th place...

if the 5th place of message have such **** word then it willl alert you as works else it will return the global msg

Show us the text in the file?

You are using a CSV Table conversion block on your incoming text, so each list item will itself be a list.

When you try to compare such a list to a piece of text, AI2 will convert that sublist to a piece of text by wrapping it with [] and maybe quotes and commas depending on its sublist contents.

Since there always will be [ ] in the converted list item, your ++++ comparison will never pass.

If you only have one column in that file, use a SPLIT at \n block on its text to get a simple one dimensional list, instead of that CSV table conversion block.

So how many columns of data are you expecting from that file

1 Like

I thought the brackets might be an issue. Is there a way to read line by line from a file. I could only find examples using csv.
Phrase1B.txt (50 Bytes)

simple
compare
test 
+++++
testing
1
3
4
5

Use the split at \n block
blocks

1 Like

Hi, thanks for your help, I tried the code you suggested and get a count of 1, should be 4
Not sure why, totally alludes me

Thoma


s

Show us your new text file, so we can see how many instances of 'PLAYER' are in it.

Also, how were you able to read from a file with an empty file name?