Skip to content

Instantly share code, notes, and snippets.

@ruthtillman
Last active September 17, 2015 20:15
Show Gist options
  • Select an option

  • Save ruthtillman/b128011eb86f7471271d to your computer and use it in GitHub Desktop.

Select an option

Save ruthtillman/b128011eb86f7471271d to your computer and use it in GitHub Desktop.

Add new column, based on this column and extract RDF URI

cell.recon.match.id

Merging several columns

(copied from Recipes) You'd need to use the 'cells' variable:

cells["col1"].value + cells["col2"].value

If any of cells in the columns are blank, the merge will fail for that row. To fix, create a facet of blank cells with "Text Facet" ⇒ "Customized Facets" ⇒ "Facet by Blank". Then use "Edit Cells" ⇒ "Transform ..." and enter a string with a space: ' '.

Using Regex to Custom Text Facet to find broken URL

Accidentally left out the level "id" in the URL for just 12 entries.

value.match(/(.*)(\/authors\/\d{9})(.*)/)

Finds the link, finds the relevant section and sees authors abutts the PID, and then facets on that. Then I simply replaced substring.

value.replace("authors","authors/id")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment