Skip to content

Instantly share code, notes, and snippets.

@zonuexe
Created October 24, 2011 09:06
Show Gist options
  • Save zonuexe/1308631 to your computer and use it in GitHub Desktop.
Save zonuexe/1308631 to your computer and use it in GitHub Desktop.
はじめてJavaをしゃべった。Javaはわらってくれた。
package me.zonu.dt;
import au.com.bytecode.opencsv.CSVReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.List;
public class CSVMyTest {
public static void main(String[] args) throws IOException {
String str = "a\tb\tc\nfooo\tbarr\tbuzbuz";
StringReader strr = new StringReader(str);
CSVReader reader = new CSVReader(strr,'\t', '\"');
List<String[]> strList = reader.readAll();
for (int i = 0; i < strList.size(); i++){
for(int j = 0; j < strList.get(i).length; j++){
System.out.print(strList.get(i)[j]);
System.out.print("\t");
}
System.out.println("");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment