The idea is to separate pieces with the split function that does not contain spaces, commas, semicolons, etc. But the function does not separate correctly, separating most of the time just the space.
public String[] getTokens(String s)
{
String[] tokens;
tokens = s.split(",");
tokens = s.split(" ");
int pos = 0;
for(int i = 0; i < tokens.length; i++)
{
if(tokens[i].equals(";") || tokens[i].equals(","))
{
tokens[i] =" ";
pos = i;
break;
}
}
public void execute()
{
File[] filesArray = dt.returnFiles();
for(File f : filesArray)
{
try
{
fileContent = dt.loadFile(f);
for(int i=0; i < fileContent.size(); i++)
{
if(fileContent.get(i).equals(",") || fileContent.get(i).equals(";") ||
fileContent.get(i).isEmpty())
{
fileContent.remove(i);
}
}