Merging data in Open/LibreOffice Calc

空扰寡人 提交于 2020-01-03 21:06:08

问题


I have two sets of data in .csv format which share a field called sku. The second one has additional columns which need to be added to the first, but they have different sets of data, only some of which overlaps.

The only data that needs to be merged is for skus that already appear in the first. For example:

File 1

sku,foo
a,hello
b,world

File 2

sku,bar
a,0
b,1
c,2
d,3

would result in:

sku,foo,bar
a,hello,0
b,world,1

Is this possible?


回答1:


In OpenOffice:

  1. Copy paste your two dataset into the same workbook in two different worksheet.

  2. use the function vlookup (same as in Excel) to merge your two data set in the same worksheet. The syntax is =VLOOKUP( valueToSearchFor ; tableToSearchIn ; columnIdentifier ; isTableSorted? ) (source)

  3. Then you can use the concatenate function CONCATENATE(text1; text2; ... text30) to merge your content into a single cell. (source)



来源:https://stackoverflow.com/questions/6709225/merging-data-in-open-libreoffice-calc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!