Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I am very new to Java and I am trying to compile "+" in the file Reactions.csv. Here's what I have so far:

// Trial.java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.*;




public class Trial{



 public static void main(String[] arg) throws Exception {



BufferedReader b1 = 

        new BufferedReader(new FileReader("Reactions.csv"));





String strRead;



while ((strRead=b1.readLine())!=null){

 String splitarray[] = strRead.split("\t");

 String firstentry = splitarray[0];

 String secondentry = splitarray[7];
}


String input = b1.readLine;



Pattern p = Pattern.compile("[+]");

Matcher m = p.matcher(input);

        List<String> genes = new ArrayList<String>();
        while (m.find()) {
            System.out.println("Found a " + m.group() + ".");
            genes.add(m.group());
        }


 } //main()

} // Trial

I am getting an error that says "cannot find symbol" b1.readline. I want this line to read line by line from Reactions.csv but clearly it's not working.

Any ideas?

share|improve this question
2  
Don't reinvent the wheel. opencsv.sourceforge.net –  Dave Jarvis Jun 6 '13 at 17:44
 
As mentioned below, this should be on Stack Overflow instead since you're getting errors. You may still edit this post with the corrected code and request additional feedback. –  Jamal Jun 6 '13 at 17:45
add comment

closed as off topic by John Syrinek, svick, p.s.w.g, Glenn Rogers, Joe F Jun 6 '13 at 23:14

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

This should be b1.readLine(). It is a method, not an instance variable.

(and most of the time, instance variables in Java are not accessible to "outsiders" anyway)

(note: this should be on stackoverflow)

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.