private double extractAmountFromKeywordListAndReturnSum() {
    List<Double> list = new ArrayList<>();
    List<String> datelist = new ArrayList<>();
    int count = 0;
    double sum = 0;
    for (int a = 0; a < this.selectedBlock.size(); a++) {

      String value = FileUtils.getLastElementFromArray(this.selectedBlock.get(a));
      value = FileUtils.getDollarSignRemovedValue(value);
      double d = FileUtils.convertStringToDouble(value);
      String[] temp = this.selectedBlock.get(a).trim().split(" ");
      datelist.add(temp[0]);
      list.add(d);
    }
    for (int a = 0; a < list.size(); a++) {
      double d = list.get(a);
      if (d < 3000) {

        ++count;
      } else {
        keywordAmount.add(d);
        keywordDate.add(datelist.get(a));
        keywordDescription.add(keyDescription.get(a));
        sum += d;
      }
    }
    setNoOfValuesLessThan3000(count);
    return sum;
  }
  private void captureSelectedBlockForDebit() {
    List<String> List = new ArrayList<>();
    List<Double> list = new ArrayList<>();
    List<String> datelist = new ArrayList<>();
    List<Double> CheckDailyPaymentAmount = new ArrayList<>();

    for (int x = 0; x < debitBlock.size(); x++) {
      for (int a = 0; a < words.size(); a++) {
        String wordLine = words.get(a).toLowerCase();
        String result = FileUtils.getResultFromPattern(wordLine, debitBlock.get(x).toLowerCase());
        if (!result.startsWith("NoMatch")) {
          for (int R = x; R > 0; R--) {
            if (debitBlock.get(R).matches("^\\s*\\d{1,2}/\\d{1,2}/\\d{1,2}.+")) {
              List.add(debitBlock.get(R));
              dailykeyDescription.add(words.get(a).toLowerCase());
              break;
            }
          }
          break;
        }
      }
    }
    for (int a = 0; a < List.size(); a++) {
      String value = FileUtils.getLastElementFromArray(List.get(a));
      value = FileUtils.getDollarSignRemovedValue(value);
      double d = FileUtils.convertStringToDouble(value);
      String[] temp = List.get(a).trim().split("\\s+");
      datelist.add(temp[0]);
      list.add(d);
    }
    for (int a = 0; a < list.size(); a++) {
      double d = list.get(a);
      if (CheckDailyPaymentAmount.contains(d)) {
        //  if (!DailypaymentkeywordDescription.contains(dailykeyDescription.get(a)))
        //  {
        DailypaymentkeywordAmount.add(d);
        DailypaymentkeywordDate.add(datelist.get(a));
        DailypaymentkeywordDescription.add(dailykeyDescription.get(a));
        //  }
      } else {
        CheckDailyPaymentAmount.add(d);
      }
    }
  }
  private void captureOnlineTransferToRecords() {
    List<String> firstLine = new ArrayList<>();
    List<String> secondLine = new ArrayList<>();
    List<Integer> indexFinder = new ArrayList<>();
    List<String> mergedLine = new ArrayList<>();

    for (int a = 0; a < this.selectedBlock.size(); a++) {
      String result =
          FileUtils.getResultFromPattern(
              "ONLINE\\s+BANKING\\s+TRANSFER\\s+TO", this.selectedBlock.get(a));

      if (!result.startsWith("NoMatch")) {
        indexFinder.add(a + 1);
        firstLine.add(this.selectedBlock.get(a));
        String[] temp = this.selectedBlock.get(a).split("\\s+");
        date.add(temp[0]);
        String value =
            FileUtils.getDollarSignRemovedValue(
                FileUtils.getLastElementFromArray(this.selectedBlock.get(a)));
        double d = FileUtils.convertStringToDouble(value);
        amount.add(d);
        String desc = "";
        for (int x = 1; x < temp.length - 1; x++) {
          desc += temp[x] + " ";
        }
        description.add(desc);
      }
    }
    for (int a = 0; a < indexFinder.size(); a++) {
      String val = selectedBlock.get(indexFinder.get(a));

      String result = this.description.get(a) + " " + val;
      String ch = FileUtils.getResultFromPattern("TO\\s+XX+\\d+", result);
      if (!ch.startsWith("NoMatch")) {
        ch = FileUtils.getFourDigitAccountNumber(ch);
        checkNo.add(ch);
      } else {
        checkNo.add("N/A");
      }
    }
  }
 private String captureDate() {
   String result = FileUtils.getResultFromPattern("to\\s+\\d{2}/\\d{2}/\\d{2}", pages[0]);
   return FileUtils.getLastElementFromArray(result);
 }