Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// http://jocke.jaiku.com/presence/42937304#c-1480362
import java.io.*;
import java.util.regex.*;
public class CO { 
  public static void main(String[] args) throws IOException { 
    BufferedReader r = new BufferedReader( 
      new InputStreamReader(new FileInputStream(args[0]), "UTF-8")); 
    Pattern p = Pattern.compile("([0-9]+):\u2013"); 
    long sum = 0; 
    while (true) { 
      String s = r.readLine(); 
      if (s == null) break; 
      Matcher m = p.matcher(s); 
      while (m.find()) sum += Long.parseLong(m.group(1)); 
    } 
    System.out.println(sum); 
  }
}