I have a text file which contains data in one line, and I want to extract words from the text file.
The words I want to extract are: "id" and "token"
With Java I can read the file:
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
public class ReadStringFromFile
{
public static void main(String[] args) throws IOException
{
File file = new File("test.txt");
String string = FileUtils.readFileToString(file);
System.out.println("Read in: " + string);
}
}
As the text file is in one line, I do not know how I can extract a value from the String.