May 8th, 2017, 12:17 AM
Join Date: May 2017
Time spent in forums: 54 m 29 sec
Reputation Power: 0
Originally Posted by anupamjamatia
Hello, I have two text files say CMU.txt and SNLTR.txt file which I have to merge based on the condition of En_Hi.txt files.
In the En_Hi.txt files if the tag is hindi (hi) it will choose from SNLTR file if the tag in En_Hi.txt file is english (en) it will choose from CMU.txt file.
Can anyone give some highlight on this matter please.
please find the contents of the three files here.
CMU.txt file have
kuch§NNP bhi§NNP max§NNP
Vivekanand§NNP Narayan§NNP Vedang§NNP Chauhan§NNP Pragyensh§NNP Kumar§NNP Harsh§JJ Kumar§NNP Narula§NNP Mritunjay§NNP Tiwari§NNP That§DT reminds§VBZ me§PRP of§IN something§NN .§.
Reminds§VBZ me§PRP of§IN Ravi§NNP Bhoraskar§NNP Jaspreet§NNP Saluja§NNP Shainky§NNP !§.
SNLTR.txt file have
kuch§JQ bhi§NC max§VM
Vivekanand§RDF Narayan§RDF Vedang§RDF Chauhan§RDF Pragyensh§RDF Kumar§RDF Harsh§RDF Kumar§RDF Narula§RDF Mritunjay§RDF Tiwari§RDF That§RDF reminds§RDF me§RDF of§RDF something§RDF .§PU
Reminds§NC me§PP of§RDF Ravi§RDF Bhoraskar§RDF Jaspreet§RDF Saluja§RDF Shainky§RDF !§PU
En_Hi.txt file have
kuch$hi bhi$hi max$en
Vivekanand$hi Narayan$hi Vedang$hi Chauhan$hi Pragyensh$hi Kumar$hi Harsh$en Kumar$hi Narula$hi Mritunjay$hi Tiwari$hi That$en reminds$en me$en of$en something$en .$univ
Reminds$en me$en of$en Ravi$hi Bhoraskar$hi Jaspreet$hi Saluja$hi Shainky$hi !$univ
Thanks and Regards
Find the below method to merge two files
OPEN INPUT FILE1, FILE2.
DISPLAY FS1, FS2.
OPEN OUTPUT FILE3.
PERFORM UNTIL EOF = 'YES'
READ FILE1 AT END MOVE 'YES' TO EOF
NOT AT END
READ FILE2 AT END MOVE 'YES' TO EOF
NOT AT END
IF EMPNO1 = EMPNO2
REC1 TO REC3
REC2 TO REC3
CLOSE FILE1, FILE2, FILE3.