Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jumiprado
Creator
Creator

Truncate Text

Hey guys! I need your help again!

I have a field with string with numbers and letters and  I need take only a part of the string

for example:

001024110672  SILVA VERONICA FERNANDA      01OT2407197405000

001048562116  BARRERA SOFIA MORENA        02HO0203200805000

I need to take the text in bold font, i try with this UPPER(replace(keepChar(NAME,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '),' ','')) as NAME but i have 2 letters in the alphanumeric string.

001024110672  SILVA VERONICA FERNANDA      01OT2407197405000

001048562116  BARRERA SOFIA MORENA        02HO0203200805000


How can i do for take only SILVA VERONICA FERNANDA and BARRERA SOFIA MORENA


Thanks You!

1 Solution

Accepted Solutions
sunny_talwar

May be TextBetween()

Trim(TextBetween(NAME, ' ', ' ')) as NAME

UPDATE: May be this:

Trim(Mid(NAME, FindOneOf(NAME, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), FindOneOf(NAME, ' ', -1) - FindOneOf(NAME, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) as NAME;

Capture.PNG

View solution in original post

4 Replies
sunny_talwar

May be TextBetween()

Trim(TextBetween(NAME, ' ', ' ')) as NAME

UPDATE: May be this:

Trim(Mid(NAME, FindOneOf(NAME, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), FindOneOf(NAME, ' ', -1) - FindOneOf(NAME, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))) as NAME;

Capture.PNG

Chanty4u
MVP
MVP

try this

a:

LOAD * INLINE [

    Field

    001024110672  SILVA VERONICA FERNANDA      01OT2407197405000

    001048562116  BARRERA SOFIA MORENA        02HO0203200805000

];

Result:

LOAD *,

PurgeChar(Field,'0123456789') as new

Resident a;

prgr.PNG

Anonymous
Not applicable

This works for me....

data:
LOAD
trim(SubField(input,' ',2)) as new_input;
LOAD * INLINE [
input
001024110672 SILVA VERONICA FERNANDA 01OT2407197405000
001048562116 BARRERA SOFIA MORENA 02HO0203200805000
]
;

swuehl
MVP
MVP

Are the first part and the last part of fixed length? Looking at your sample, it could be 12 and 17 chars.

This could help in filtering your names:

Trim(Mid(NAME, 13, Len(NAME)-(12+17))) as NAME