split long string based on position of delimiterHi
I have a column that has long strings (see example below). I want to extract all the text after the 7th delimiter of "_" from the right. I tried munger but doesnt seem working well at the end part.
can someone provide suggestion how I can do it right?
1)shjdjsh._ndjrpe_hfkjd_tyrwytre5_hlhm_jgds.d._jkdjf_hfkd_a
desired output: ndjrpe_hfkjd_tyrwytre5_hlhm_jgds.d._jkdjf_hfkd_a
2)hhd_wew_klf:_jdbfjdf_qwkokv_ctls_msdn_a_f_g_skjd_lad_vtl_sdjnskjshdja_jndf_skdj_ccf
desired output: g_skjd_lad_vtl_sdjnskjshdja_jndf_skdj_ccf
Automation and ScriptingRe: split long string based on position of delimiterHere is the formula I used
Substr(
:Column 1,
Contains( :Column 1, Word( -8, :Column 1, "_" ) )
)

Re: split long string based on position of delimiterYou could use Word() with negative indices
Names Default To Here(1);
str1 = "shjdjsh._ndjrpe_hfkjd_tyrwytre5_hlhm_jgds.d._jkdjf_hfkd_a";
result1 = "ndjrpe_hfkjd_tyrwytre5_hlhm_jgds.d._jkdjf_hfkd_a";
str2 = "hhd_wew_klf:_jdbfjdf_qwkokv_ctls_msdn_a_f_g_skjd_lad_vtl_sdjnskjshdja_jndf_skdj_ccf";
result2 = "g_skjd_lad_vtl_sdjnskjshdja_jndf_skdj_ccf";
res1 = Word([-8 -1], str1, "_");
res2 = Word([-8 -1], str2, "_");
res1 == result1;
res2 == result2;