기본 콘텐츠로 건너뛰기

4월, 2017의 게시물 표시

java copy file skip first line

package readline; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; public class Test { public static void main(String[] args) throws Exception { String somepath = "d:/f1.txt"; writeFile("d:/line0.txt","11111113232"); writeFile("d:/line1.txt","11111113232\n11111113232\n11111113232\n11111113232"); writeFile("d:/line1lf.txt","11111113232\n11111113232\n11111113232\n11111113232"); writeFile("d:/line1crlf.txt","11111113232\r\n11111113232\r\n11111113232\r\n11111113232"); somepath = "d:/line0.txt"; copyLine(somepath,somepath+".tmp"); s