Advertisement
Guest User

nim compare files

a guest
Feb 15th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import algorithm, os
  2.  
  3. var
  4. psp: array[100_000_000, string]
  5. index: int
  6. file_cur = open("cur.csv")
  7. file_new = open("new.csv")
  8.  
  9. index = 0
  10. for line in file_cur.lines:
  11. psp[index] = line
  12. index += 1
  13.  
  14. sort(psp, system.cmp[string])
  15.  
  16. index = 0
  17. for line in file_new.lines:
  18. if binarySearch(psp, line) == -1: echo line
  19.  
  20. file_cur.close()
  21. file_new.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement