package p;
public class pro {
int s,datanumber;
String[] data=new String[50000];
String[] year=new String[50000];
String[] v=new String[50000];
int number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
String urlx="https://opendata.resas-portal.go.jp/api/v1/municipality/plant/perYear?cityCode=11362&simcCode=20&prefCode=11&sicCode=E";
getdata sub=new getdata();
sub.makedata(urlx,"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
String[] x=str.split("},");
for(s=0;s<x.length;s++){
int p1=x[s].indexOf("year");
p1=x[s].indexOf(":",p1);
int p2=x[s].indexOf(",",p1);
year[s+1]=x[s].substring(p1+1,p2);
p1=x[s].indexOf("value");
p1=x[s].indexOf(":",p1);
p2=x[s].indexOf("}",p1);
if(p2<1)p2=x[s].length();
v[s+1]=x[s].substring(p1+1,p2);
System.out.println(year[s+1]+","+v[s+1]);
}
number=x.length;
}
}
最終更新:2017年03月02日 10:54