Fastest Way to Delete a Line from Large File in Python

前端 未结 9 662
轮回少年
轮回少年 2020-11-30 03:58

I am working with a very large (~11GB) text file on a Linux system. I am running it through a program which is checking the file for errors. Once an error is found, I need

9条回答
  •  天涯浪人
    2020-11-30 04:43

    @OP, if you can use awk, eg assuming line number is 10

    $ awk 'NR!=10' file > newfile
    

提交回复
热议问题