package api;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[50000];
String[] id=new String[500];
String[] name=new String[500];
String[] tab=new String[500];
int number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
String code="00200524";
String urlx="http://api.e-stat.go.jp/rest/2.1/app/getStatsList?appId=aeec3b02995623cad42b80c80f73d176b7c77970";
urlx=urlx+"&statsCode="+code;
getdata sub=new getdata();
sub.makedata(urlx,"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
int sx=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("<TABLE_INF")>-1)sx=sx+1;
if(data[s].indexOf("<TABLE_INF")>-1)id[sx]=data[s];
}
number=sx;
sx=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("<STATISTICS_NAME>")>-1)sx=sx+1;
if(data[s].indexOf("<STATISTICS_NAME>")>-1)name[sx]=data[s];
}
sx=0;
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("<TITLE no")>-1)sx=sx+1;
if(data[s].indexOf("<TITLE no")>-1)tab[sx]=data[s];
}
for(s=1;s<number+1;s++){
int p1=id[s].indexOf("\"");
int p2=id[s].indexOf("\"",p1+1);
id[s]=id[s].substring(p1+1,p2);
System.out.println(id[s]);
p1=name[s].indexOf(">");
p2=name[s].indexOf("<",p1+1);
name[s]=name[s].substring(p1+1,p2);
System.out.println(name[s]);
p1=tab[s].indexOf(">");
p2=tab[s].indexOf("<",p1+1);
tab[s]=tab[s].substring(p1+1,p2);
System.out.println(tab[s]);
}
}
}
最終更新:2017年03月02日 06:48