Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
Here's the problem, my data is coming in wrapped in square brackets, e.g. [www.google.com]
Can I remove the square brackets, either by:
1. Removing the first and last character of a line in the loadscript?
2. Removing all '[' and ']' from my data?
Thanks!
Alex
Hi Alex,
There are multiple ways to achieve that, see examples below.
1. Removing the first and last character of a line in the loadscript?
A. This will ignore the first and last character:
LOAD
mid(Field,2,len(Field)-1) as Field
(...);
B. This will look for the brackets to get what's in between then:
LOAD
textbetween(Field,'[',']') as Field
(...);
2. Removing all '[' and ']' from my data?
C. This will remove any occurence of brackets in any position:
LOAD
PurgeChar(Field,'[]') as Field
(...);
Hope this helps you.
Cesar
Hi,
Use below expression:
LOAD
PurgeChar(Field,'[]') as New_Field
FROM datasource;
Hope this helps you.
Regards,
Andrei Kaliahin
Hi Alex,
There are multiple ways to achieve that, see examples below.
1. Removing the first and last character of a line in the loadscript?
A. This will ignore the first and last character:
LOAD
mid(Field,2,len(Field)-1) as Field
(...);
B. This will look for the brackets to get what's in between then:
LOAD
textbetween(Field,'[',']') as Field
(...);
2. Removing all '[' and ']' from my data?
C. This will remove any occurence of brackets in any position:
LOAD
PurgeChar(Field,'[]') as Field
(...);
Hope this helps you.
Cesar
Thank you!
Thank you!
remove first and last from field
load
field,
mid(field, 2, len(field)-2)
......