Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String subFile = file;
- int startIndex;
- int endIndex = file.indexOf("Druk: ");
- subFile = subFile.substring(0, endIndex);
- while (subFile.contains("IMIĘ I NAZWISKO Funkcja Wpisany do KRS")) {
- startIndex = subFile.indexOf("IMIĘ I NAZWISKO Funkcja Wpisany do KRS");
- if (startIndex != -1) {
- subFile = subFile.substring(startIndex + 38);
- }
- }
- if (subFile.contains("TAK\r\n") || subFile.contains("NIE\r\n")) {
- while (subFile.contains("TAK\r\n")) {
- subFile = subFile.substring(subFile.indexOf("TAK\r\n") + 4);
- }
- while (subFile.contains("NIE\r\n")) {
- int a = subFile.indexOf("NIE\r\n");
- int b = subFile.length() - 5;
- if (a == b) {
- subFile = subFile.replaceAll("\r\n", " ");
- return subFile.trim();
- }
- if (!" ".equals(String.valueOf(subFile.charAt(subFile.indexOf("NIE\r\n") - 1)))) {
- String charA = "\n";
- String charB = String.valueOf(subFile.charAt(subFile.indexOf("NIE\r\n")-1));
- if (!charA.equals(charB))
- return subFile.substring(0, subFile.indexOf("NIE\r\n") + 5).replaceAll("\r\n", "").trim();
- }
- subFile = subFile.substring(subFile.indexOf("NIE\r\n") + 4);
- }
- if (!subFile.contains("O FUNKCJI\r\nPEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU KONTROLI LUB\r\nnadzoru)")) {
- subFile = subFile.replaceAll("\r\n", " ");
- if (subFile.contains("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")) {
- if (subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")).trim().length() == 0) {
- return subFile.substring(subFile.indexOf("IMIĘ I NAZWISKO Funkcja Wpisany do KRS"));
- }
- return subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")).trim();
- } else if (subFile.contains("SKŁAD ORGANU KONTROLI LUB NADZORU ORGANIZACJI nadzoru)"))
- return subFile.substring(subFile.indexOf("SKŁAD ORGANU KONTROLI LUB NADZORU ORGANIZACJI\r\nnadzoru)") + 57).trim();
- else if (subFile.contains("CHARAKTERYSTYKA DZIAŁALNOŚCI ORGANIZACJI POŻYTKU PUBLICZNEGO"))
- return subFile.substring(0, subFile.indexOf("CHARAKTERYSTYKA DZIAŁALNOŚCI ORGANIZACJI POŻYTKU PUBLICZNEGO")).trim();
- else return subFile.trim();
- } else {
- subFile = subFile.substring(subFile.indexOf("O FUNKCJI\r\nPEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU KONTROLI LUB\r\nnadzoru)") + 82);
- subFile = subFile.replaceAll("\r\n", " ");
- return subFile.trim();
- }
- } else {
- if (!subFile.contains("PEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU ZARZĄDZAJĄCEGO")) {
- if(!subFile.contains("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")){
- subFile = subFile.replaceAll("\r\n", " ");
- return subFile.trim();}else{
- subFile = subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO") );
- return subFile.trim();
- }
- } else {
- subFile = subFile.substring(subFile.indexOf("PEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU ZARZĄDZAJĄCEGO") + 61);
- subFile = subFile.replaceAll("\r\n", " ");
- return subFile.trim();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement