import java.io.*;
public class pro{
int s,sx,datanumber,articlenumber;
String[] data=new String[50000];
String[] dic=new String[50000];
int[][] num=new int[1000][30000];
int p;
int xlong,h,dicnumber;
String file;
int n,sxs,maxn;
public static void main(String[] args){
pro test=new pro();
}
pro(){
readfile("lib.txt");
for(s=1;s<datanumber+1;s++){
dic[s]=data[s];
}
readfile("data.txt");
articlenumber=datanumber;
for(s=1;s<datanumber+1;s++){
String[] x=data[s].split(",");
xlong=x.length;
for(sx=1;sx<xlong+1;sx++){
num[s][sx]=Integer.parseInt(x[sx-1]);
}
}
for(sx=1;sx<100;sx++){
System.out.println(num[30][sx]);
}
}
void readfile(String file){
String str;
BufferedReader br;
int s;
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;
}
void writefile(){
try{
PrintWriter pw = new PrintWriter
(new BufferedWriter(new FileWriter("data.txt")));
for(s=1;s<901;s++){
for(sx=1;sx<dicnumber;sx++){
pw.print(num[s][sx]);
pw.print(",");
}
sx=dicnumber;
pw.println(num[s][sx]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
}
catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
}
最終更新:2011年06月14日 05:48