Skip to content

Instantly share code, notes, and snippets.

@ostephens
Created May 14, 2015 14:53
Show Gist options
  • Save ostephens/3573bb5d21ed33ae5b08 to your computer and use it in GitHub Desktop.
Save ostephens/3573bb5d21ed33ae5b08 to your computer and use it in GitHub Desktop.
Match in GREL
[
{
"op": "core/column-addition",
"description": "Create column Material Description at index 1 based on column Description using expression grel:value.replace(/\\n/,\" \").match(/(.*)Typewritten text:(.*)/)[0]",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Material Description",
"columnInsertIndex": 1,
"baseColumnName": "Description",
"expression": "grel:value.replace(/\\n/,\" \").match(/(.*)Typewritten text:(.*)/)[0]",
"onError": "set-to-blank"
},
{
"op": "core/column-addition",
"description": "Create column Material Transcription at index 1 based on column Description using expression grel:value.replace(/\\n/,\" \").match(/(.*)Typewritten text:(.*)/)[1]",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"newColumnName": "Material Transcription",
"columnInsertIndex": 1,
"baseColumnName": "Description",
"expression": "grel:value.replace(/\\n/,\" \").match(/(.*)Typewritten text:(.*)/)[1]",
"onError": "set-to-blank"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment