Need to extract a particular string from a excel cell using excel formula.
Input string:
CREATE TABLE IF NOT EXISTS ${SCHEMA_NM}.beneficiary_enriched STORED AS ORC tblproperties("orc.compress"="SNAPPY") AS SELECT DISTINCT source, individual_analytics_identifier, preferred_proxy_id, demogr_first_name, demogr_last_name, birth_date, gender, zip_code, state, coverage_effective_date, coverage_expiration_date FROM ${SCHEMA_NM}.beneficiary_decrypted;
Output string:
| col1 | col2 |
|---|---|
| ${SCHEMA_NM}.beneficiary_enriched | ${SCHEMA_NM}.beneficiary_decrypted |
Want to extract table name from create statement. col1 has 'new table name' and col2 has 'from table name' starting from '$'
Formula i tried:(not working in all cases)
For getting new table name:
=MID(A1,SEARCH("$",A1)+1,(LEN(A1)-(SEARCH("$",A1)+1))-(LEN(A1)-SEARCH(" ",A1,((LEN(LEFT(A1,SEARCH("$",A1)-1))+1)))))```
Help me get the correct output.
