I have a column field: location
. I need to extract the string between the first and second delimeter ('/').
I already have a column name
where I ltrim
to the first '/'
. I've tried to create a similar query with a combination of rtrim
, replace
, substr
as my source
column to no avail. Here is what my data looks like. I want to extract AML
, for example. Right now, there are only three options (value1, value2, value3) between the first and second delimiters, but there could be more later.
Attribute data
----------+--------------------------------------------------------------------------------------------------------------------
Field | First value
----------+--------------------------------------------------------------------------------------------------------------------
location | './AML/Counties/*****************kyaml_20190416_transparent_mosaic_group1.tif'
name | 'kyaml_20190416_transparent_mosaic_group1.tif'
----------+--------------------------------------------------------------------------------------------------------------------
What is the best way of creating my column source
with the value from location
?
Output should be like this:
Attribute data
----------+--------------------------------------------------------------------------------------------------------------------
Field | First value
----------+--------------------------------------------------------------------------------------------------------------------
location | './AML/Counties/****************kyaml_20190416_transparent_mosaic_group1.tif'
name | 'kyaml_20190416_transparent_mosaic_group1.tif'
source | 'AML'
----------+--------------------------------------------------------------------------------------------------------------------