I am trying to use regexp_substr to break up table data held in one cell to the individual fields.
the data is , delimited. individual cells can also contain , within quotes and finally some cells can be unpopulated
My sample logic is working for the first 2 requirements but i can't sort the third, please help!
the issue is b4 should be null but it is being returned as F.
SEL
'a, b, c,, F,"d, e, f", g, h' AS f1,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,1) AS b1,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,2) AS b2,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,3) AS b3,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,4) AS b4,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,5) AS b5,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,6) AS b6,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,7) AS b7,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,8) AS b8,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,9) AS b9,
RegExp_Substr(f1,'(".*?"|[^",\s]+)(?=,|$)',1,10) AS b10
;
Thanks
JF