code: public static void main(String[] args) throws Exception {
      if (args.length < 2) {
        logger.info("using BatchReplaceMain dir patternfile encoding");
        return;
      }
      String dir = args[0];
      if (!new File(dir).exists()) {
        logger.error("{} not a valid file or directory", dir);
        return;
      }
      String properties = args[1];
      if (!new File(properties).exists()) {
        logger.info("{} not valid file or directory", properties);
      }
      Charset charset = null;
      if (args.length >= 3) {
        charset = Charset.forName(args[2]);
      }
      List<String> lines = Files.readLines(new File(properties));
      Map<String, List<Replacer>> profiles = CollectUtils.newHashMap();
      List<Replacer> replacers = null;
      for (String line : lines) {
        if (Strings.isEmpty(line)) {
          continue;
        }
        if (-1 == line.indexOf('=')) {
          replacers = CollectUtils.newArrayList();
          profiles.put(line, replacers);
        } else {
          line = Strings.replace(line, "\\=", "~~~~");
          String older = Strings.replace(Strings.substringBefore(line, "="), "~~~~", "=");
          String newer = Strings.replace(Strings.substringAfter(line, "="), "~~~~", "=");
          older = Strings.replace(older, "\\n", "\n");
          older = Strings.replace(older, "\\t", "\t");
          newer = Strings.replace(newer, "\\n", "\n");
          newer = Strings.replace(newer, "\\t", "\t");
          Replacer pair = new Replacer(older, newer);
          replacers.add(pair);
        }
      }
      replaceFile(dir, profiles, charset);
    }
docs: Usage:BatchReplaceMain dir patternfile encoding
  @param args args
  @throws Exception
  when read files