简体   繁体   English

使用 python 将 2 个 excel 文件与参考列进行比较

[英]Compare 2 excel file with a reference column using python

I want to compare 2 excel files (file1 & file2) with a unique column as reference (eg: Emp ID).我想将 2 个 excel 文件(file1 和 file2)与一个唯一列作为参考(例如:Emp ID)进行比较。 Based on this unique ID, compare every row data from file1 against the corresponding row data in file2 and create an output file with all the columns from file1 and mismatching row data (with mismatching columns only) from file2 in format shown in image.基于此唯一 ID,将 file1 中的每一行数据与 file2 中的相应行数据进行比较,并创建一个 output 文件,其中包含 file1 中的所有列和 file2 中不匹配的行数据(仅具有不匹配的列),格式如图所示。

This current script works for 2 files identical in shape, order and format of data.此当前脚本适用于 2 个形状、顺序和数据格式相同的文件。 Need help to validate based on reference column.需要帮助根据参考列进行验证。

enter image description here在此处输入图像描述

Just use spreadsheet compare tool, if this is one time job,只需使用电子表格比较工具,如果这是一次性工作,

it's a built-in tool in windows它是 windows 中的内置工具

Spreadsheet Compare

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM