アットウィキロゴ

名簿作成

package follower;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;




public class pro {

    int s,datanumber;
    String[] data=new String[10000];
    String str,strx;
  
    public static void main(String[] args) {
        pro test=new pro();
    }
pro(){

    String c,cx;
    int p1,p2;
     c=" ";
    cx=" ";
    
    readfile("akb.txt");
    
    for(s=1;s<datanumber+1;s++){
        
    str=data[s];
    p1=str.indexOf(c);
    strx=str.substring(p1+1,str.length());
    p2=strx.indexOf(cx);
    str=strx.substring(0,p2);
    System.out.println(str);
    }
    
    
    
    
}

void readfile(String file){

String str;
BufferedReader br;  

s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"SJIS"));  
while((str = br.readLine()) != null) {  
s=s+1;
data[s]=str;  
}
br.close();
} catch (IOException e) {System.out.println(e);}  

datanumber=s;

}
}
最終更新:2012年10月07日 19:18