I want to strip characters outside of the curly brackets in rows that look like the following.
35|{......}|
Stripping the '35|' from the front and the trailing '|' from the end.
{.....}
Initially working on the first 3 characters, I try the following but it removes everything.
a = LOAD '/file' as (line1:chararray);
b = FOREACH x generate REPLACE(line1, '35|','');
dump b;
Any thoughts appreciated. Thanks.
| and { and } are special characters in regular expressions and the second parameter for REPLACE is a regular expression. Try to escape the characters:
b = FOREACH x generate REPLACE(line1, '35\\|','');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With