I have the dataset of reviews of products and I want to extract text between text from that file and print.How can I extract Data File contains data in the following format
<review> id
<reviewer></reviewer>
<start word></end word>
</review>
my code is like
File file = new File("D://Data/Dataset/unlabeled.review");
FileInputStream fis = new FileInputStream(file);
byte[] bytes = new byte[(int) file.length()];
fis.read(bytes);
fis.close();
String text = new String(bytes, "UTF-8");
System.out.println(text.substring(text.indexOf("<start word>"), text.lastIndexOf("</end word>")));