我一直在Open Refine上清理一张桌子。我现在有这样的话:
var dataURL = canvas.toDataURL({
format: 'png',
multiplier: 20
})
var pdf = new jsPDF();
pdf.addImage(dataURL, 'PNG', 0, 0);
pdf.save("download.pdf");
}
我需要在REF和Size中拆分那些多值单元格,以便得到:
REF Handle Size Price
2002, 2003 t-shirt1 M, L 23
3001, 3002, 3003 t-shirt2 S, M, L 24
是否可以在Open Refine中执行此操作? "拆分多值单元格......"命令只处理一列。 谢谢, 安娜丽塔
答案 0 :(得分:3)
是的,有可能:
这是我在GREL中的食谱:
[
{
"op": "core/row-removal",
"description": "Remove rows",
"engineConfig": {
"facets": [
{
"invert": false,
"expression": "row.starred",
"selectError": false,
"omitError": false,
"selectBlank": false,
"name": "Starred Rows",
"omitBlank": false,
"columnName": "",
"type": "list",
"selection": [
{
"v": {
"v": true,
"l": "true"
}
}
]
}
],
"mode": "row-based"
}
},
{
"op": "core/multivalued-cell-split",
"description": "Split multi-valued cells in column Column 1",
"columnName": "Column 1",
"keyColumnName": "Column 1",
"separator": ", ",
"mode": "plain"
},
{
"op": "core/column-move",
"description": "Move column Column 2 to position 0",
"columnName": "Column 2",
"index": 0
},
{
"op": "core/multivalued-cell-split",
"description": "Split multi-valued cells in column Column 3",
"columnName": "Column 3",
"keyColumnName": "Column 2",
"separator": ", ",
"mode": "plain"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column Column 4",
"engineConfig": {
"facets": [],
"mode": "record-based"
},
"columnName": "Column 4"
},
{
"op": "core/fill-down",
"description": "Fill down cells in column Column 2",
"engineConfig": {
"facets": [],
"mode": "record-based"
},
"columnName": "Column 2"
},
{
"op": "core/column-reorder",
"description": "Reorder columns",
"columnNames": [
"Column 1",
"Column 2",
"Column 3",
"Column 4"
]
}
]
埃尔韦
答案 1 :(得分:0)
刚刚找到了一个不错的免费 OpenRefine 插件,它提供了“未配对的枢轴”: VIB-Bits plugin
3.2.1 未配对枢轴... 未配对数据透视是将按行组织的数据转换为该数据的表示 单独列中的数据。一个简单的例子是转换
类别 | 价值 |
---|---|
一 | 1 |
一 | 2 |
b | 3 |
c | 2 |
进入
值a | 值 b | 值 c |
---|---|---|
1 | 3 | 2 |
2 |