You listed junit in the tag.
Junit's .equals(double, double, accuracy) allows you to specify how close they have to be with the last parameter.
I'd just read in the values and call .equals for each in a test...
or is there something to the question I'm not getting?
To parse the lines, your examples use spaces but you say "CSV" (Comma Separated). If they actually are CSV you could use something like:
String[] line = currentLine.split(",")
on each line. That would give you line[0]="item1", line[1]="5.12", line[2]="6.12"
After that try parsing line[1] and line[2] with Double.parseDouble()
By the way, use assertEquals, not assertTrue, the more specific assertEquals will display the value you wanted and the value you got as part of your error in the junit results.
I also recommend you pass in the optional string. The test line would look like this:
assertEquals("item "+file1.line[0]+" values do not match",
Double.parseDouble(file1.line[1]),
Double.parseDouble(file2.line[1]),
0.001)
There is also the whole problem of making sure you are reading the same line for each file--getting them paired right. If they are guaranteed to be in the same order you are fine, but if not you might want to hash up the first file by the name field:
for(String line: file1.readNextLine())
file1hash.put(line.split(",")[0],line)
Then as you iterate through the second file you can easily do:
for(String line2: file2.readNextLine()) {
String line1=file1hash.get(line2.split(",")[0])
to make sure line1 and line2 refer to the same line.