Java??.CSV????ж???????д??
???????????? ???????[ 2013/3/5 9:36:09 ] ????????
????.CSV????????????????????????????????????ж???????????棬??????????????????????????????е??????????
import java.io.BufferedReader;
import java.io.FileReader;
public class TestRead {
public static void main(String[] args) {
try {
BufferedReader reader = new BufferedReader(new FileReader("a.csv"));//????????????
reader.readLine();//?????????????????????????????????????
String line = null;
while((line=reader.readLine())!=null){
String item[] = line.split("??");//CSV??????????????????????????????з?
String last = item[item.length-1];//???????????????
//int value = Integer.parseInt(last);//?????????????????????
System.out.println(last);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
????д??????????????????????????????д????????ɡ?
package com.mark.csv;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
public class WriteCSV {
public static void main(String[] args) {
try {
File csv = new File("F:/writers.csv"); // CSV???????
BufferedWriter bw = new BufferedWriter(new FileWriter(csv?? true)); // ????
// ????μ???????
bw.write(""????"" + "??" + ""1988"" + "??" + ""1992"");
bw.newLine();
bw.close();
} catch (FileNotFoundException e) {
// File?????????????е???????
e.printStackTrace();
} catch (IOException e) {
// BufferedWriter??????????
e.printStackTrace();
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11