I have a data like below with tab limited among them. I have represented them with a view here
with t_view as (select '6-21 6-21 6-21 6-21 6-21 6-21 6-21 ' as col from dual
union
select '6-20 6-20 6-20 6-20 6-20 ' from dual
union
select '6-9 6-9 6-9 6-9 6-9 6-9 6-9 ' from dual)
My expected output is
Mon: 6-21, Tue: 6-21, Wed: 6-21, Thu: 6-21, Fri: 6-21, Sat: 6-21, Sun: 6-21
Mon: 6-20, Tue: 6-20, Wed: 6-20, Thu: 6-20, Fri: 6-20
Mon: 6-9, Tue: 6-9, Wed: 6-9, Thu: 6-9, Fri: 6-9, Sat: 6-9, Sun: 6-9
I thought of replacing all those horizontal table with some unique patterns like this and then replace that pattern with Mon, Tue based on indexing
$1(6-20 )$2(6-20 )$3(6-20 )$4(6-20 )$5(6-20 )
I have tried the below query but could not complete it
select regexp_replace(col, '([[:digit:]]-[[:digit:]]{2}[[:space:]]+)','$(\1)') from t_view;