Compare more than two CSV's using batch script

June 22, 2020 at 03:11:03
Specs: Windows 7
Hi ALL,

I have same use case as mentioned in the below link and I have referred same batch script mentioned in below link

https://www.computing.net/answers/p...

In addition I want to compare two more CSV's that have a common column named as "Department". But, there is a condition to create the output xml. If the values "Department" in all 3 CSV's are same then create a common tag for the rows else create another tag if "Department" is unmatched.

CSV's format are as follow:

CSV 1:

Department Emp_Name Emp_No
Development Priya 23
Development Neel 21
HR Sneha 45
HR Riya 76
Testing Swapna 54


CSV 2:

Deparment city_branch

HR pune
HR Mumbai
R&D Delhi

CSV 3:

Deparment city_branch_code
Devolopment D123
HR H123
R&D R321
Marketing M456


Expected output:
<Department = Development>
<Emp_Name=Priya Emp_No=23 />
<Emp_Name=Neel Emp_No=21 />
<city_branch_code=D123/>
</Department>

<Department = HR>
<Emp_Name=Sneha Emp_No=45 />
<Emp_Name=Riya Emp_No=76 />
<city_Bracnch=pune/>
<City_branch=Mumbai/>
<city_branch_code=H123>
</Department>

<Department = Testing>
<Emp_Name=Swapna Emp_No=54 />
<Emp_Name=Aakash Emp_No=34 />
</Department>

<Department =R&D >
< city_branch=Delhi/>
<city_branch_code=R321/>
</Department>

<Department =Marketing >
<city_branch_code=M456/>
</Department>


Any help??


See More: Compare more than two CSVs using batch script

Reply ↓  Report •
Related Solutions


Ask Question