Compare 2 files and split the required fields

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Compare 2 files and split the required fields

Sneha C
Hello All,

Please consider the below scenario.
File1:
1|ABCD1234|Hello
2|XYZ89712|Hi
3|PQRS2344|Hello

File2:
ABCD
XYZ
PQRS

Expected Output File:
ABCD|1234
XYZ|89712
PQRS|2344

So in the above example, I am trying to match field2 of File1 with File2 Data and upon matching, the File1 Data is split in 2 different fields.

Can anyone please help, how can I acheive the above scenario