Created
March 29, 2016 10:22
-
-
Save FGFW/63d3a942bb9b69b69f05 to your computer and use it in GitHub Desktop.
julia文件合并排序.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
julia文件合并排序.jl | |
http://bbs.bathome.net/thread-39841-1-1.html | |
2016年3月29日 17:29:48 codegay | |
思路如crlf所说,找出不存target中id,合并然后sort排序就可以. | |
""" | |
indexio=open("index2.txt") | |
targetio=open("target2.txt") | |
indtxt=[strip(r) for r in readlines(indexio)] | |
#@show indtxt | |
tartxt=readlines(targetio) | |
tarind=[split(r)[1] for r in tartxt] | |
#@show tarind | |
notin=filter(x -> !(x in tarind),indtxt) | |
#@show notin | |
notin=[string(r,"\r\n") for r in notin] | |
#@show sort([tartxt;notin]) | |
result=open("out.txt","w+") | |
write(result,sort([tartxt;notin])) | |
close(indexio) | |
close(targetio) | |
close(result) | |
#[Finished in 4.3s] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment