Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. String path= Entry_file.getPath();
  2.  
  3. String ch2="cmd /c C:\TreeTagger\bin\tag-english"+" "+path;
  4.  
  5.  
  6. Process p2;
  7. try {
  8. p2 = Runtime.getRuntime().exec(ch2);
  9. p2.waitFor();
  10. System.out.println(p2.exitValue());
  11. BufferedWriter output=new BufferedWriter(new FileWriter(Etiq_result));
  12. BufferedReader input =
  13. new BufferedReader
  14. (new InputStreamReader(p2.getInputStream()));
  15.  
  16. String line;
  17.  
  18. while((line = input.readLine()) != null)
  19. {
  20. System.out.println("line "+line);
  21. output.write(line);
  22. output.flush();
  23. output.write("rn");
  24. output.flush();
  25.  
  26.  
  27. }
  28.  
  29. }
  30. catch (InterruptedException e) {
  31. e.printStackTrace();
  32. } catch (IOException e1) {
  33. e1.printStackTrace();
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement