How to perform an union of two files containing keywords in python? -


मेरे पास 2 अलग-अलग पाठ फ़ाइलें हैं।

File1.txt में शामिल हैं:

  प्रोग्राम रैम पायथन पार्सर   

File2.txt में शामिल हैं:

  फ़ाइल 1234 प्रोग्राम   

मैं चाहता हूं

  प्रोग्राम रैम पायथन पार्सर फ़ाइल 1234   

क्या यह संभव है कि इन दोनों फ़ाइलों का एक संघ निष्पादित करें प्रोग्राम अजगर में है? मैं अजगर 2.7

  के साथ ओपन ("file1.txt") के रूप में fin1 का उपयोग कर रहा हूँ: lines = ओपन ("file3.txt", 'w') के साथ fout: fout के रूप में ("file2.txt") के साथ खुले ("फ़ाइल 2.txt") सेट करें (फाईल 2): fin.lines.update (सेट (fin2.readlines ())) .write ('\ n'.join (सूची (पंक्तियाँ)))    

Comments

Popular posts from this blog

sql - Return Function using Cursor -

c++ - why does this code produce a runtime error? -

javascript - Is there any way to add a new parameter to a function programmatically? -