Tag: skip

在Java中读取CSV文件时跳过第一行

嘿家伙我正在编写解析器代码来读取.csv文件并将其解析为XML。 这是我的代码,它工作正常,但我希望它跳过文件中的第一行。 所以我决定设置一个HashMap,但它似乎确实有效: for (int i = 0; i < listOfFiles.length; i++) { File file = listOfFiles[i]; if (file.isFile() && file.getName().endsWith(".csv")){ System.out.println("File Found: " + file.getName());//Prints the name of the csv file found String filePath = sourcepath + "\\" + file.getName(); BufferedReader br = new BufferedReader(new FileReader(file)); String line; int n = 1; Map lineMap […]