(スペルミスで申し訳ありません) 出力は .cvs ファイルからのものです
"First Name","Last Name","Main-Email","Current Employer","Internal Contact ID","PSI Club Member Nbr.","Membership Type","Membership Status","Member since", "会員カード送信","会員開始日","会員有効期限","国籍1","会員ID" "Pierre","ABT","piero.a@bluewin.ch",,"1655", "1350","居住者更新","アクティブ","1968-01-01","2011 年 2 月 10 日","1968-01-01","1968-12-31",,"1915" ","ADAM","bruno.adam@bluewin.ch","OCTAVE GROUP","1656","5288","居住者の更新","アクティブ","2012-01-01","2012 年 2 月 16 日","2012-01-01","2012-12-31","フランス","424
i want output in this way..separate line between each data.How to do frnds..
here is my code can any guide me..thanks in advance.
"Bruce", |"ADAMS", |"bruce.adams@bluewin.ch",|,"1657",|"883",|"Resident Renewal",|"Active",|"2011-05-10",|,"2012-01-01",|"2012-12-31",|"Canada",
| | | | |
| | | | |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.StringTokenizer;
public class FileRead {
/**
* @param args
*/
public static void main(String[] args) {
String fileName="C:/Users/Desktop/cvsFile.csv";
try {
BufferedReader br = new BufferedReader( new FileReader(fileName));
String strLine = null;
StringTokenizer st = null;
int lineNumber = 0, tokenNumber = 0;
while( (fileName = br.readLine()) != null)
{
lineNumber++;
/* String[] result = fileName.split("[\r\n]+");
for (int x=0; x<result.length; x++) {
System.out.println(result[x]);*/
//break comma separated line using ","
st = new StringTokenizer(fileName, "|");
while(st.hasMoreTokens())
{
//display csv values
tokenNumber++;
System.out.println("Line # " + lineNumber + " Token : "+ st.nextToken());
}
//reset token number
tokenNumber = 0;
}
// }
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
上記の画像出力をJavaで行うためのtrオプションはありますか
。このように出力したいです。誰でも私を導くことができます..上にコードがあります...真ん中に、出力データを区切る行が必要です。前もって感謝します..