Easiest scripting method to merge two text files - Ruby, Python, JavaScript, Java?

前端 未结 6 796
一个人的身影
一个人的身影 2021-01-14 21:14

I have two text files, one containing HTML and the other containing URL slugs:

FILE 1 (HTML):

  • 6条回答
    •  春和景丽
      2021-01-14 22:01

      Python is great language Just have a look at these six lines of python they can merge any big text file, just now i have merged 2 text file of 10 GB each.

       o = open("E:/temp/3.txt","wb") #open for write
       for line in open("E:/temp/1.txt","rb"):
           o.write(line)
       for line in open("E:/temp/2.txt","rb"):
           o.write(line)
       o.close()
      

    提交回复
    热议问题