Find and replace across multiple columns

530 views
Skip to first unread message

ThomasVee

unread,
Apr 3, 2017, 11:06:44 PM4/3/17
to OpenRefine
I have a dataset with more than 20 columns. I`m using a two step workflow using Regex to find, replace and delete text after a certain character in each column. Is there any way I can do find and replace in one shot across all the columns?

Thad Guidry

unread,
Apr 3, 2017, 11:33:04 PM4/3/17
to OpenRefine
Unfortunately no.  Open Refine does its operations against per column.
Someone created an enhancement issue to have that feature, but we never implemented it due to lack of time, funds, motivation.

Many of us however just use Google Sheets or even Unix tools to accomplish this task easily.  Google Sheets even supports Regex for that find replace across all sheets as well.  As with all free online tools, there's a limit for number of cells ... https://support.google.com/drive/answer/37603?visit_id=1-636268734143422044-2483090556&rd=1

-Thad

On Mon, Apr 3, 2017 at 10:06 PM ThomasVee <thoma...@gmail.com> wrote:
I have a dataset with more than 20 columns. I`m using a two step workflow using Regex to find, replace and delete text after a certain character in each column. Is there any way I can do find and replace in one shot across all the columns?

--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Vattakaven

unread,
Apr 4, 2017, 12:32:18 AM4/4/17
to openr...@googlegroups.com
Thanks Thad,
I didnt realise you could do it in Google sheets. I Found an addin which allowed me to do this with excel called Regex Find and Replace.
I hope this feature will be implemented in Open Refine at some point in future.

Regards,

Thomas


To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "OpenRefine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openrefine/0dx1ciZpetI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openrefine+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ettore Rizza

unread,
Apr 4, 2017, 8:24:43 AM4/4/17
to OpenRefine
Of course, a simple search & replace can be done in a spreadsheet - or even in a text editor if the file is a .csv. 

But what if you want to perform a more complex operation on each column of your project? Here is a little trick that use the "templating" function to reproduce a series of operations in Json format. In this case, the operation is "transform text to number" and, as you can see, it takes two minutes.

The screencast may seem a bit complicated, but it's always better than manually transforming over one hundred columns.

https://youtu.be/tkMk0Bk5zFg

Thad Guidry

unread,
Apr 4, 2017, 10:17:56 AM4/4/17
to OpenRefine
Thomas,

I think some of the extensions developed for OpenRefine already do a global search/replace.

Perhaps others on the mailing list know which ones specifically.  I've forgotten.

Scroll down to the bottom half of this page to see the list we maintain of known extensions.

-Thad

--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.

Owen Stephens

unread,
Apr 5, 2017, 5:52:28 AM4/5/17
to OpenRefine
Thanks Ettore

Possible short cut to getting the column names - rather than taking the file into Excel, you can use:

row.columnNames

Within a transform or custom text facet to get the list of column names

Owen

Owen Stephens

unread,
Apr 5, 2017, 5:56:38 AM4/5/17
to OpenRefine
I'm sorry, I'm not aware of any extensions which do a global find/replace. If anyone does know one that does this please share!

Owen

Ettore RIZZA

unread,
Apr 5, 2017, 6:30:14 AM4/5/17
to openr...@googlegroups.com
Thanks Owen, I had forgotten that there was a colnames() method for rows. 

And I have never seen an extension that installed an "apply to each column" function. It's clearly in the Top 3 features for which I would be ready to pay a little bounty (the other two are: "create a new project from a faceted view" and "facet selected rows")

To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages