How can i sort large csv file without loading to memory

前端 未结 3 2095
北海茫月
北海茫月 2021-02-20 05:23

I have 20GB+ csv file like this:

**CallId,MessageNo,Information,Number** 
1000,1,a,2
99,2,bs,3
1000,3,g,4
66,2,a,3
20,16,3,b
1000,7,c,4
99,1,lz,4 
...

3条回答
  •  孤独总比滥情好
    2021-02-20 05:31

    you should use python for this kind of tasks :)

    have a look here for a similar, full working example:

    Python: How to read huge text file into memory

    EDIT:

    in that same answer there is a link useful in case your file is really way bigger than available amount of RAM: http://code.activestate.com/recipes/466302/

提交回复
热议问题