10.9.12

Error: smartSplit error: Un-terminated quoted field at end of CSV line

I am a big fan of the smartSplit function. It is really easy to understand and help to extract quickly part of a string based on any character. However if while using the smartSplit function a cells contains a double quote - " - sign, google refine will return the following error message
Error: smartSplit error: Un-terminated quoted field at end of CSV line

Here is my work around.


Issue

In our example we want to extract links from a tweet. As a tweet could have multiple link I split its content in multiple cells based on the string http and then transpose all the new column into one.

Now I want to extract only the first word of each cell, for this I use the following function:
value.smartSplit(' ')[0]
and I get the following preview:


As you can see, my first cells returns the error:
 Error: smartSplit error: Un-terminated quoted field at end of CSV line

This is due to the  double quote - " - mark in the string.

Solution

Before using the smartSplit function remove all quotation mark and then re run the smartSplit function. This will solve your problem!