Date form a csv file

I’d start by debugging your code to understand exactly what’s going on. For example what is the value of m?

I’d also try to isolate the problem: is the problem in reading the file, in comparing the value, something else? Try to come up with a smaller MCVE that demonstrates what’s going on without any extra code.

But the first thing that jumps out at me is you’re comparing String values using the == operator, which is almost never what you want.

From the Processing reference:

To compare the contents of two Strings, use the equals() method, as in if (a.equals(b)), instead of if (a == b). A String is an Object, so comparing them with the == operator only compares whether both Strings are stored in the same memory location. Using the equals() method will ensure that the actual contents are compared. (The troubleshooting reference has a longer explanation.)

1 Like