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

c - Performance of System() -

python - how we can use ajax() in views.py in django? -

c++ - How to define methods in a base class that only work in derived classes? -