摘要: 分别用sed awk perl grep 实现: 1 sed '/^$/d' input.txt > output.txt #output file: output.txt 2 sed -i '/^$/d' input.txt #output file: input.txt 3 awk 'NF > 阅读全文
posted @ 2014-08-02 10:42 emanlee 阅读(13508) 评论(0) 推荐(2)
摘要: num_lines = sum(1 for line in open(input_file_name)) 阅读全文
posted @ 2014-08-02 10:34 emanlee 阅读(3918) 评论(0) 推荐(0)