Guest User

Untitled

a guest
Aug 14th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import java.io.*;
  2. import java.nio.*;
  3. import java.nio.file.*;
  4. import java.util.*;
  5. import java.util.regex.*;
  6.  
  7. public class Biostar332826
  8. {
  9. public static void main(final String args[]) throws Exception {
  10. final Set<String> rs = new HashSet<>(
  11. Files.readAllLines(Paths.get(args[0]))
  12. );
  13. final Pattern tab = Pattern.compile("[\t]");
  14. final BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
  15. String line;
  16. while((line=r.readLine())!=null)
  17. {
  18. if(line.startsWith("#")) {
  19. System.out.println(line);
  20. continue;
  21. }
  22. final String tokens[]=tab.split(line,4);
  23. if(rs.contains(tokens[2])) {
  24. System.out.println(line);
  25. }
  26. }
  27.  
  28. r.close();
  29. }
  30. }
Add Comment
Please, Sign In to add comment