简体   繁体   中英

Merge two csv files based on common column

I have two csv files with data, which contains one common column with the same data (ex. product P/N that is unique).

How to merge all data into one spreadsheet?

File one

P/N | Name        | Quantity
xxx | Product xxx | 3
zzz | Product zzz | 6
yyy | Product yyy | 0

File two

P/N | Image
zzz | Image URL zzz
xxx | Image URL xxx
yyy | Image URL yyy

What i want?

P/N | Name        | Quantity | Image 
xxx | Product xxx | 3        | Image URL xxx
zzz | Product zzz | 6        | Image URL zzz
yyy | Product yyy | 0        | Image URL yyy

My approach would be to use VLOOKUP on the P/N in file one and grab the data from file two.

VLOOKUP(p/n,filetwotable,2,0)

drag this down to the bottom of column D, modify the third parameter (2) for the next two columns in columns E and F.

I would copy/paste special values to kill the formulas.

I do this often; I create a template then drop the data into it.

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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