Search code examples
regexbashopenrefinegrel

Delete everything before a double quote


I'm trying to clean a CSV file which has a column with contents like this:

Sometexthere1", "code"=>"47.51-2-01"}]

And I would like to remove everything before the first quote (") in order to keep just this:

Sometexthere1

I know that I can use $` to get everything before some match in regex, but I am not understanding how to keep just the string before the first double quote.


Solution

  • You probably mean "delete everything after a double quote"? In Open Refine, you can use this GREL formula :

    value.replace(/".+/, "")
    
    
    > Result : Sometexthere1