Quote:
which are about twenty four lines but the actual file contains about four hundred lines
You forgot to show us what is the input file.
First thing: check what was read from file.
public class StringUtilitiesFromFile {
public static void main(String[] args) throws IOException
{
File file = new File("D://French/FrenchWords/Auth.html");
String string = FileUtils.readFileToString(file);
System.out.println(string);
System.out.println("------------------------------------------");
String And = string.replaceAll("\\(.*\\)", "");
System.out.println(And);
System.out.println("");
}
}
[Update]
Quote:
the contents of the file are here, have pasted about thirty lines actual file is much longer
Then you know file read is ok, now change the RegEx replace with RegEx match, and print a match per line.