parameterized history commands

49 kali dilihat
Langsung ke pesan pertama yang belum dibaca

fabius pocus

belum dibaca,
16 Sep 2022, 05.32.5716/09/22
kepadaOpenRefine
Hi. OR can save command in a json file. It is useful to recall them for similar data. I don't know if you can parameterized them in some way. If you use column 2 but it has a diferent names in different datasets? Thanks,

Fabio

Owen Stephens

belum dibaca,
16 Sep 2022, 05.42.4916/09/22
kepadaOpenRefine
Unfortunately there's no way to parameterise the commands in the JSON history file.
The only way of doing something like you propose at the moment would be to manipulate the JSON history before applying it. For example if we had the operation history from a project with "Column 1", and we wanted to apply to a project where it was called "Column A" instead - you'd have to extract the operation history which might look like:

[
  {
    "op": "core/text-transform",
    "engineConfig": {
      "facets": [],
      "mode": "row-based"
    },
    "columnName": "Column 1",
    "expression": "grel:\"test\"",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10,
    "description": "Text transform on cells in column Column 1 using expression grel:\"test\""
  }
]

And replace all the occurrences of "Column 1" with "Column A" to get:

[
  {
    "op": "core/text-transform",
    "engineConfig": {
      "facets": [],
      "mode": "row-based"
    },
    "columnName": "Column A",
    "expression": "grel:\"test\"",
    "onError": "keep-original",
    "repeat": false,
    "repeatCount": 10,
    "description": "Text transform on cells in column Column A using expression grel:\"test\""
  }
]


Then apply the operation history to your new project.
Of course if you do this you have to be careful not to affect anything except the column names (e.g. if you had a column called 'description' and you wanted to replace with 'desc.' you couldn't just do a find and replace on the word 'description' because that would affect the description field in the history - and then the history wouldn't work. 

Owen

fabius pocus

belum dibaca,
16 Sep 2022, 06.39.4916/09/22
kepadaOpenRefine
Thanks a lot.
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru