MCPcopy Index your code
hub / github.com/Bit0r/java-util / readFileByLine

Method readFileByLine

src/main/java/util/AddTableField.java:38–55  ·  view source on GitHub ↗

按行读取文件 @param strFile

(String strFile)

Source from the content-addressed store, hash-verified

36 * @param strFile
37 */
38 public static List<String> readFileByLine(String strFile) {
39 List<String> strList = new ArrayList<>();
40 try {
41 File file = new File(strFile);
42 BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
43 String strLine = null;
44 int lineCount = 1;
45 while (null != (strLine = bufferedReader.readLine())) {
46 strList.add(strLine);
47// log.info("第[" + lineCount + "]行数据:[" + strLine + "]");
48// System.out.println("第[" + lineCount + "]行数据:[" + strLine + "]");
49 lineCount++;
50 }
51 } catch (Exception e) {
52 e.printStackTrace();
53 }
54 return strList;
55 }
56
57 /**
58 * 按行读取全部文件数据

Callers 1

upEntityClassMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected