Created
October 24, 2011 09:06
-
-
Save zonuexe/1308631 to your computer and use it in GitHub Desktop.
はじめてJavaをしゃべった。Javaはわらってくれた。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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