extract a string by deleting first letter and last letter

3 posts / 0 new
Last post
petter01
Offline
Joined: 03/11/2019 - 17:20
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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.

ravisdxb
Offline
Joined: 01/13/2019 - 06:12

Please try @mid(@Trim(MY_FIELD), 2, @len(@Trim(MY_FIELD)) -2)