Extracting info from large structured text files

后端 未结 5 1200
鱼传尺愫
鱼传尺愫 2021-01-15 18:22

I need to read some large files (from 50k to 100k lines), structured in groups separated by empty lines. Each group start at the same pattern \"No.999999999 dd/mm/yyyy ZZZ

5条回答
  •  时光说笑
    2021-01-15 19:06

    It looks good overall, but why do you have the line:

    rpi = (line for line in rpi)
    

    You can already iterate over the file object without this intermediate step.

提交回复
热议问题