Page 1 of 1

Grabbing X number of characters from the end of a line

Posted: Fri May 02, 2014 2:03 pm
by pink
as the subject says, I'm looking to take the last 7 characters from each line of a field and put them into another field, so I will start with something like this:

ABSD-A234567
LKI:A654321
A987654
BUFA314151

and end up with:

A234567
A654321
A987654
A314151

so, the last 7 bits of info are the only relevant part I want to keep, and the rest of it can vary in size and may or may not have a delimiter

This was my most recent try which didn't work:

Code: Select all

     repeat for each line mmPin in field "input"
          put last 7 char of mmPin & return after the field "output"
     end repeat
Any thoughts?
Thanks,
Greg

Re: Grabbing X number of characters from the end of a line

Posted: Fri May 02, 2014 2:18 pm
by LCNeil
Hi Greg,

Try something like this-

Code: Select all

on mouseUp
   repeat for each line mmPin in field 1
                put char -7 to -1 of mmPin & return after  field 2
        end repeat
end mouseUp
nb Replace the field names with your field names :)

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

Re: Grabbing X number of characters from the end of a line

Posted: Fri May 02, 2014 5:07 pm
by pink
That did it, THANKS!