posted 6 years ago
Hello, I am having two files with the contents as below.
File 1 has below text: It has two fields GUID and Numeric Long separated by space.
0000334b-456c-43c6-8bbc-0646d812cd6e 187370527
000052d6-93fa-441e-aa7b-a60c4e89e216 182309392
c86b1537-b2a2-4f3b-91a1-11297ca41638 171322512
74a58e5b-4c68-4080-9b14-5ee41077596a 117893365
024fd966-07bf-4987-91f2-a3396fab9e73 182769240
000074f5-b922-45dc-8bd5-71c59c61db07 180424080
000090b8-8f5e-41c1-a37f-e8a7b65097e7 124692533
0000ab04-fe0a-44c7-8bdd-521a824cde59 210584325
0000e5a2-0e77-445e-9f83-264b92947dde 182877504
File 2 has below text:
0000334b-456c-43c6-8bbc-0646d812cd6e,0.0000,0,0,3,0,TRUE
000052d6-93fa-441e-aa7b-a60c4e89e216,0.0000,0,0,3,0,TRUE
c86b1537-b2a2-4f3b-91a1-11297ca41638,1.0000,0,2955,1,0,TRUE
74a58e5b-4c68-4080-9b14-5ee41077596a,1.0000,0,3339,1,0,TRUE
024fd966-07bf-4987-91f2-a3396fab9e73,0.5000,0,154,1,0,TRUE
000074f5-b922-45dc-8bd5-71c59c61db07,0.0000,0,0,3,0,TRUE
000090b8-8f5e-41c1-a37f-e8a7b65097e7,0.0000,0,0,3,0,TRUE
We need to compare the file 1 to file 2 line by line and if we find the GUID of file 1 in file 2 then replace the GUID with the Numeric Long which is present beside to the GUID.
Output should be like below: Either this can be in new text file or even fine if it updates the file 2.
187370527,0.0000,0,0,3,0,TRUE
182309392,0.0000,0,0,3,0,TRUE
171322512,1.0000,0,2955,1,0,TRUE
117893365,1.0000,0,3339,1,0,TRUE
182769240,0.5000,0,154,1,0,TRUE
180424080,0.0000,0,0,3,0,TRUE
124692533,0.0000,0,0,3,0,TRUE
Please help me here. I am in need of this desperately.
Thanks in advance.