Advertisement
Guest User

Untitled

a guest
May 16th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public static void ReadSearch(){
  2.  
  3. String filepath = "C:/werkruimte/kmuren/input/test.txt";
  4. String searchTerm = "";
  5. String kenteken = ""; String date = ""; String begin = ""; String ending = ""; String junk3 = ""; String junk4 = ""; String junk5 = ""; String junk6 = ""; double kilom = 0; String junk7 = ""; String junk8 = "";
  6. String junk9 = ""; String junk10 = ""; String junk11 = ""; String junk12 = "";
  7.  
  8. try
  9. {
  10. for (int i = 0, n = licenses.size(); i < n; i++)
  11. {
  12.  
  13. searchTerm = licenses.get(i);
  14. System.out.println(searchTerm);
  15. x = new Scanner(new File(filepath));
  16. x.useDelimiter("[;\n]");
  17.  
  18. String line;
  19. while(x.hasNext() ||
  20. x.hasNextDouble()) {
  21.  
  22. kenteken = x.next();
  23. date = x.next();
  24. begin = x.next();
  25. ending = x.next();
  26. junk3 = x.next();
  27. junk4 = x.next();
  28. junk5 = x.next();
  29. junk6 = x.next();
  30. kilom = x.nextDouble();
  31. junk7 = x.next();
  32. junk8 = x.next();
  33. junk9 = x.next();
  34. junk10 = x.next();
  35. junk11 = x.next();
  36. junk12 = x.next();
  37.  
  38.  
  39. if((kenteken.toLowerCase()).contains(searchTerm.toLowerCase()))
  40. {
  41. System.out.println("successmessage\n\n");
  42. kilometers.add(i, kilom);
  43.  
  44. }
  45. else
  46. {
  47. kilometers.add(i, 0.001);
  48.  
  49. }
  50.  
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement