package movie;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[500000];
String[] dic=new String[5000];
String[] code=new String[5000];
String[] name=new String[500000];
int number;
String[] id=new String[500000];
int[] point=new int[5000000];
public static void main(String[] args) {
pro te=new pro();
}
pro(){
dic sub52=new dic();
sub52.makedata();
dic=sub52.dic;
number=sub52.number;
code=sub52.code;
readx("n.csv");
for(s=1;s<datanumber;s++){
String[] x=data[s+1].split(",");
name[s]=x[2];
}
for(s=1;s<datanumber;s++){
String str=sub52.rev(name[s]);
id[s]=sub52.check(str);
if(id[s].length()<1)id[s]=sub52.search(name[s]);
System.out.println(name[s]+","+id[s]);
}
writexml("ren.csv");
}
void writexml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s=1;s<datanumber;s++){
pw.print(data[s+1]);
pw.print(",");
pw.println(id[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
void readx(String file){
String str;
BufferedReader br;
int s;
s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
while((str = br.readLine()) != null) {
s=s+1;
data[s]=str;
}
br.close();
} catch (IOException e) {System.out.println(e);}
datanumber=s;
}
int numx(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
最終更新:2016年07月26日 09:09