Questions tagged «high-performance»


10
按行号过滤文件
给定一个文件L,每行一个非负整数,并且文本文件F,那么仅将行号出现在文件L中的那些行保留在F中的快速方法是什么? 例: $ cat L.txt 1 3 $ cat F.txt Hello World Hallo Welt Hola mundo $ command-in-question -x L.txt F.txt Hello World Hola mundo 我正在寻找一个可以处理具有5亿或更多条目的文件L的命令;文件L按数字排序。 注意:我已经完成了的实现的一半,command-in-question但是我只是想知道,这里是否也可以使用某些Unix工具。 更新:感谢您提供所有答案,我今天学到了很多东西!我想接受一个以上的答案,但这是不可能的。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.