import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class getCoords {

	String listOfStopIds[] ={"E2223", "E2226", "E2204", "E2215", "E2024", "E2022","E2310","E2332","1014","1233"};

	
	public void getCoords() throws Exception{
		
	
		for(int i=0; i < listOfStopIds.length;i++ ){
			URL url = new URL("http://api.reittiopas.fi/hsl/prod/?user=jussi&pass=infinity&request=stop&code=" + 
						listOfStopIds[i] +"&p=00000001&format=text");
			BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
			String inputline = in.readLine();
			Pattern pattern = Pattern.compile(":\"(..)(.*),(..)(.*)\"");
			Matcher matcher = pattern.matcher(inputline);
			if (matcher.find()) {
			    System.out.println("\"test\",\""+matcher.group(1)+"."+matcher.group(2)+","+matcher.group(3)+"."+matcher.group(4)+"\"");
			    
			}
			
		}
		System.out.println("Finished");
	}
	
		public static void main(String [] args){
			getCoords get = new getCoords();
			try {
				get.getCoords();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
		
		
	
	
	
	
	
	
}

@@ -331,18 +331,63 @@
 ion%7B%0A%09%09%0A
+%09%09System.out.println(%22longitude, latitude%22);%0A
 %09%0A
-
 %09%09for(in
@@ -871,22 +871,8 @@
 tln(
-%22%5C%22test%5C%22,%5C%22%22+
 matc
@@ -950,13 +950,8 @@
 p(4)
-+%22%5C%22%22
 );%0A%09
@@ -1224,18 +1224,183 @@
 %7D%0A%09%09%0A%09%09%0A
-
 %09%09
+//convert to kml: http://www.mapsdata.co.uk/online-file-converter/#kml-instructions%0A%09%09//conver kml to ddms compatible kml: http://lab.soledadpenades.com/android/kml/
 %0A%09%0A%09%0A%09%0A%09

added instructions to convert csv to ddms compat. kml