Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. @ComponentInfo(name="CSVReader", category="Custom")
  2. public class CSVReader implements java.io.Serializable {
  3. private static final long serialVersionUID=1L;
  4.  
  5. // ---- add your code here -----
  6.  
  7. public void plot(
  8. @ParamInfo(name="CSV File", style="load-dialog", options="") File input,
  9. @ParamInfo(name="Column", style="default", options="value=0") int col) {
  10.  
  11. input.eachLine{l->
  12. l = l.trim();
  13. String[] numbers = l.split(";");
  14.  
  15. String stringVal = numbers[col];
  16. double value = java.lang.Double.parseDouble(stringVal);
  17.  
  18. // do something with the value
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement