code: public static <T> T splitEachLine(CharSequence self, Pattern pattern, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
          final List<String> list = readLines(self);
          T result = null;
          for (String line : list) {
              List vals = Arrays.asList(pattern.split(line));
              result = closure.call(vals);
          }
          return result;
      }
docs: Iterates through the given CharSequence line by line, splitting each line using
  the given separator Pattern.  The list of tokens for each line is then passed to
  the given closure.
  
  @param self    a CharSequence
  @param pattern the regular expression Pattern for the delimiter
  @param closure a closure
  @return the last value returned by the closure
  @throws java.io.IOException if an error occurs
  @since 1.8.2