Read the file as shown here, and use String.split()
in each line to get the value:
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line;
while ((line = br.readLine()) != null) {
String value = line.split("=")[1];
System.out.println(value);
}
}
EXPLANATION: to read the file, is well explained in question I linked
lets see: you are processing each line of the file INDIVIDUALLY, then the content of the file (just one line) arrives to this part of the code, but what is doing this line?
String value = line.split("=")[1];
line
variable, in first iteration will contain:
FORMNAME1=Cat
split("=") will create an array like this
[0] FORMNAME1
[1] Cat
so the line is assigning the value of position 1 (Cat) to the variable value
String value = "Cat";
Second iteration will do same but different content:
line = "CONTROL ID=6"
so
line.split("=")
will result
[0] CONTROL ID
[1] 6
And
// be careful is a string representing "6"
// not the numerical value 6 as int or double!!!!!
String value = "6";
and so on....
EXTRA TIP: