Using python to write specific lines from one file to another file

前端 未结 5 1889
攒了一身酷
攒了一身酷 2020-12-05 11:41

I have ~200 short text files (50kb) that all have a similar format. I want to find a line in each of those files that contains a certain string and then write that line plus

5条回答
  •  醉酒成梦
    2020-12-05 12:08

    Have you tried using something other than 'Output.txt' to avoid any filesystem related issues as the problem?

    What about an absolute path to avoid any funky unforeseen problems while diagnosing this.

    This advice is simply from a diagnostic standpoint. Also check out the the OS X dtrace and dtruss.

    See: Equivalent of strace -feopen < command > on mac os X

提交回复
热议问题