Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. try{
  2. String ExpfileName = "C:/IOTest/expFile.txt";
  3.  
  4. File file = new File(ExpfileName);
  5.  
  6. String data = readFileAsString(ExpfileName);
  7.  
  8.  
  9. Scanner exp = new Scanner (file);
  10.  
  11. exp.useDelimiter(";");
  12.  
  13. for (int i = 0; i < expTable.getRowCount(); i++){
  14. for(int j = 0; j < 4; j++)
  15. {
  16.  
  17. expTable.setValueAt(exp.next(), i, j);
  18.  
  19.  
  20. }
  21. }
  22. exp.close();
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. }catch(Exception e){
  30.  
  31. }
  32. try{
  33. String InfileName = "C:/IOTest/inFile.txt";
  34. String data2 = readFileAsString(InfileName);
  35. File file2 = new File(InfileName);
  36. Scanner income = new Scanner(data2);
  37. income.useDelimiter(";");
  38.  
  39. for (int k = 0; k < inTable.getRowCount(); k++){
  40. for(int l = 0; l < 4; l++)
  41. {
  42.  
  43. inTable.setValueAt(income.next(), k, l);
  44. }
  45. }
  46. income.close();
  47.  
  48. }catch(Exception e){
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement