package mon;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[50000];
String[] point=new String[50000];
String[] date=new String[50000];
String[] code=new String[50000];
int[] sale=new int[50];
int[] seat=new int[50];
int[] th=new int[50000];
int[] rank=new int[50000];
int[] screen=new int[50];
String[] title=new String[50000];
String[] subdata=new String[50000];
String[] credit=new String[50000];
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readfile sub2=new readfile();
sub2.makedata("data.csv","UTF-8");
data=sub2.data;
datanumber=sub2.datanumber;
System.out.println(datanumber);
int sx=0;
for(s=1;s<datanumber+1;s++){
int h=0;
if(data[s].indexOf("デイリー合算")>-1)h=h+1;
if(data[s].indexOf("中間集計")<1)h=h+1;
if(h==2)sx=sx+1;
if(h==2)point[sx]=data[s];
}
int number=sx;
for(s=1;s<number+1;s++){
String[] x=point[s].split(",");
code[s]=x[0];
date[s]=x[1];
}
for(s=1;s<number+1;s++){
credit[s]="通常";
if(date[s].indexOf("AEON")>-1)credit[s]="AEON";
}
for(s=1;s<number+1;s++){
int p1=date[s].indexOf(":");
int p2=date[s].indexOf("(",p1);
if(p2<0)p2=date[s].length();
date[s]=date[s].substring(p1+1,p2);
}
for(s=1;s<number+1;s++){
String y1=date[s].substring(0,4);
String m1=date[s].substring(4,6);
String d1=date[s].substring(6,8);
m1=""+num_int(m1);
d1=""+num_int(d1);
date[s]=y1+","+m1+","+d1;
System.out.println(date[s]);
}
sx=0;
int tr=1;
for(tr=1;tr<number+1;tr++){
movie sub=new movie();
sub.makedata(code[tr]);
rank=sub.rank;
seat=sub.seat;
sale=sub.sale;
th=sub.th;
screen=sub.screen;
title=sub.title;
for(s=1;s<26;s++){
sx=sx+1;
subdata[sx]=date[tr]+","+credit[tr]+","+rank[s]+","+sale[s]+","+seat[s]+","+screen[s]+","+th[s]+","+title[s];
}
}
writefile sub5=new writefile();
sub5.data=subdata;
sub5.datanumber=sx;
sub5.makedata("ren.csv");
}
int num_int(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
package mon;
import tool.readfile;
public class movie {
int s,datanumber;
String[] data=new String[50000];
String[] point=new String[50000];
String[] date=new String[50000];
String[] code=new String[50000];
int[] sale=new int[50];
int[] seat=new int[50];
int[] th=new int[50000];
int[] rank=new int[50000];
int[] screen=new int[50];
String[] title=new String[50000];
void makedata(String kk){
readfile sub=new readfile();
sub.makedata("data/"+kk+".txt","UTF-8");
data=sub.data;
datanumber=sub.datanumber;
int delta=5;
int s1=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("順位")>-1)s1=s;
if(data[s].indexOf("館数")>-1)delta=6;
}
int sx;
for(s=s1+1;s<datanumber+1;s++){
data[s]=data[s].replace("*","");
String[] x=data[s].split(" ");
for(sx=0;sx<x.length;sx++){
if(sx==0)rank[s-s1]=num_int(x[sx]);
if(sx==1)sale[s-s1]=num_int(x[sx]);
if(sx==2)seat[s-s1]=num_int(x[sx]);
if(sx==3)screen[s-s1]=num_int(x[sx]);
if(sx==4)th[s-s1]=num_int(x[sx]);
if(sx==delta)title[s-s1]=x[sx];
}
}
}
int num_int(String str){
int nx;
nx=0;
try{
nx=Integer.parseInt(str);
}catch (Exception e) {}
return nx;
}
}
最終更新:2017年07月01日 15:28