import java.io.*;


public class Stat {

	public static void main(String[] args) throws IOException {

		//Test
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String in = null;
		while((in=reader.readLine()) != null) {
			if(in.contains("online"))
				System.out.println("line captured: " + in);
		}

	}


}

@@ -15,91 +15,361 @@
 .*;%0A
-%0A%0Apublic class Stat %7B%0A%0A%09public static void main(String%5B%5D args) throws IOException %7B
+import java.nio.file.Paths;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.StandardOpenOption;%0Aimport java.util.Date;%0Aimport java.text.SimpleDateFormat;%0A%0A%0Apublic class Stat %7B%0A%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%0A%09%09String outPath = %22data.txt%22;%0A%0A%09%09try %7B%0A%09%09    Files.createFile(Paths.get(outPath));%0A%09%09%7D catch (Exception e) %7B%0A%09%09%7D
 %0A%0A%09%09
@@ -517,16 +517,26 @@
 null) %7B%0A
+%0A%09%09%09//in%0A%0A
 %09%09%09if(in
@@ -556,59 +556,309 @@
 line
+ (was
 %22))
+ %7B
 %0A%09%09%09%09S
-ystem.out.println(%22line captured: %22 + in);
+tring datetime = new SimpleDateFormat(%22yyyy-MM-dd HH:mm:ss%22).format(new Date());%0A%09%09%09%09String user = in.substring(8, in.indexOf(%22online%22)-1);%0A%0A%09%09%09%09String entry = datetime + %22,%22 + user + %22%5Cn%22;%0A%0A%09%09%09%09Files.write(Paths.get(outPath), entry.getBytes(), StandardOpenOption.APPEND);%0A%09%09%09%09%0A%09%09%09%7D%0A%0A%0A
 %0A%09%09%7D

Save date and name to CSV output