Skip to main content

extract a string by deleting first letter and last letter

Hello guys 
I am new in Idea analysis software
Im wondering if there is a function to extract a string by deleting first letter and last letter 
for example,
9peter019  I want to extract peter01 
I want to apply this in the name_field 
 
thank you 
 

Brian Element Tue, 03/12/2019 - 07:04

In IDEA you would create a virtual character field and use the following equation:

@mid(@Trim(MY_FIELD), 2, @len(@Trim(MY_FIELD)) -1)

I added the @Trim to remove any leading or trainling spaces.  What I am doing is using the @mid function to take the contents in your field and start at the second character and then extract all the characters except for the last one, that is what the @len is doing as it gives the number of characters in the string.

Hopefully this helps you out.