I’ve made a text file called positions.txt, and followed the instructions on the website, "Loads a text file that contains two numbers separated by a tab (’\t’) ".
When I run the script, it’s opening the txt file I’ve made, but I don’t think I’ve got the formatting right for the pairs of numbers it reads in. It seems so simple, I don’t know what I’m doing wrong.
Could you please provide me with the example text file this script is using?
For the location of the file, you can check the comments on loadStrings().
If the problem is that you are not using real tabs but spaces to separate the values on a line, you can try this alternative for data/token splitting: splitTokens
splitTokens() already uses constant WHITESPACE by default. So it can be shortened like this: String[] pieces = splitTokens(lines[index]);
If no delim characters are specified, any whitespace character is used to split. Whitespace characters include tab (\t), line feed (\n), carriage return (\r), form feed (\f), and space.