/*代码写的可能有点累赘里面的好多东西写的不太好 还望各位大佬能提点一二,不胜感激*/package com.zzp.fileopration;import java.io.*;/** * Created by hasee on 2016/11/16. */public class ReadFile { private BufferedReader br = null; public int openFile(String strAddress, String codeFormat) { if…
这工作小半年了发现以前学的那么多流弊技能都不怎么用,倒是shell用的很多,自己已经从shell小菜鸟一步步走过来,已经要变成大菜鸟=.= 经常需要用shell按行读取配置文件,自己在上面踩了很多坑,可依然没长记性,故记录下来.先创建一个测试用例toy.txt; [VasiliShi@ZXXS workplace]$ cat toy.txt this is 1 this is 2 this is 3 使用while读取 使用while读取文件时候需要配合read,利用read读取文件时,每次调用…