Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. String subFile = file;
  2. int startIndex;
  3. int endIndex = file.indexOf("Druk: ");
  4. subFile = subFile.substring(0, endIndex);
  5. while (subFile.contains("IMIĘ I NAZWISKO Funkcja Wpisany do KRS")) {
  6.  
  7.  
  8. startIndex = subFile.indexOf("IMIĘ I NAZWISKO Funkcja Wpisany do KRS");
  9.  
  10. if (startIndex != -1) {
  11. subFile = subFile.substring(startIndex + 38);
  12. }
  13.  
  14. }
  15.  
  16.  
  17. if (subFile.contains("TAK\r\n") || subFile.contains("NIE\r\n")) {
  18.  
  19. while (subFile.contains("TAK\r\n")) {
  20. subFile = subFile.substring(subFile.indexOf("TAK\r\n") + 4);
  21. }
  22.  
  23. while (subFile.contains("NIE\r\n")) {
  24. int a = subFile.indexOf("NIE\r\n");
  25. int b = subFile.length() - 5;
  26. if (a == b) {
  27. subFile = subFile.replaceAll("\r\n", " ");
  28. return subFile.trim();
  29. }
  30.  
  31. if (!" ".equals(String.valueOf(subFile.charAt(subFile.indexOf("NIE\r\n") - 1)))) {
  32. String charA = "\n";
  33. String charB = String.valueOf(subFile.charAt(subFile.indexOf("NIE\r\n")-1));
  34.  
  35. if (!charA.equals(charB))
  36. return subFile.substring(0, subFile.indexOf("NIE\r\n") + 5).replaceAll("\r\n", "").trim();
  37.  
  38. }
  39. subFile = subFile.substring(subFile.indexOf("NIE\r\n") + 4);
  40. }
  41.  
  42. if (!subFile.contains("O FUNKCJI\r\nPEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU KONTROLI LUB\r\nnadzoru)")) {
  43. subFile = subFile.replaceAll("\r\n", " ");
  44. if (subFile.contains("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")) {
  45. if (subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")).trim().length() == 0) {
  46. return subFile.substring(subFile.indexOf("IMIĘ I NAZWISKO Funkcja Wpisany do KRS"));
  47. }
  48. return subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")).trim();
  49.  
  50. } else if (subFile.contains("SKŁAD ORGANU KONTROLI LUB NADZORU ORGANIZACJI nadzoru)"))
  51. return subFile.substring(subFile.indexOf("SKŁAD ORGANU KONTROLI LUB NADZORU ORGANIZACJI\r\nnadzoru)") + 57).trim();
  52. else if (subFile.contains("CHARAKTERYSTYKA DZIAŁALNOŚCI ORGANIZACJI POŻYTKU PUBLICZNEGO"))
  53. return subFile.substring(0, subFile.indexOf("CHARAKTERYSTYKA DZIAŁALNOŚCI ORGANIZACJI POŻYTKU PUBLICZNEGO")).trim();
  54.  
  55. else return subFile.trim();
  56. } else {
  57. subFile = subFile.substring(subFile.indexOf("O FUNKCJI\r\nPEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU KONTROLI LUB\r\nnadzoru)") + 82);
  58. subFile = subFile.replaceAll("\r\n", " ");
  59. return subFile.trim();
  60. }
  61. } else {
  62. if (!subFile.contains("PEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU ZARZĄDZAJĄCEGO")) {
  63.  
  64. if(!subFile.contains("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO")){
  65. subFile = subFile.replaceAll("\r\n", " ");
  66. return subFile.trim();}else{
  67. subFile = subFile.substring(0, subFile.indexOf("OPIS DZIAŁALNOŚCI POŻYTKU PUBLICZNEGO") );
  68. return subFile.trim();
  69. }
  70. } else {
  71. subFile = subFile.substring(subFile.indexOf("PEŁNIONEJ PRZEZ POSZCZEGÓLNYCH CZŁONKÓW ORGANU ZARZĄDZAJĄCEGO") + 61);
  72. subFile = subFile.replaceAll("\r\n", " ");
  73. return subFile.trim();
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement