我有一个CSV文件,其中电子邮件计数为550,我希望打开我的网站并搜索此电子邮件ID,然后单击“保存”按钮。对于所有550个电子邮件,处理过程都是相同的。
请建议我如何才能一一检查。
我用这个,但是不起作用:
public static void main(String[] args) throws IOException
{
try
{
ArrayList<String> ar = new ArrayList<String>();
File csvFile = new File("C:\\Users\\umesh.yadav\\Downloads\\test.xls");
BufferedReader br = new BufferedReader(new FileReader(csvFile));
String line = "";
StringTokenizer st = null;
int lineNumber = 0;
int tokenNumber = 0;
while ((line = br.readLine()) != null) {
String[] arr = line.split(",");
//for the first line it'll print
System.out.println(arr[0]+" " + arr[1]); // h
// System.out.println("arr[1] = " + arr[1]); // Vito
lineNumber++;
//use comma as token separator
}
}
catch(IOException ex) {
ex.printStackTrace();
}
finally{
//System.out.println("thank you");
}
}