October 7, 200916 yr I have 10K+ records with a fields holding values similar to these; AAA_02_1234 AAA_102_3456 AAA_5102_9876 AAA_7_HAMBERGER ZZZ_22_12346 ZZZ_442_12346 PCDD_18_05 The majority of them follow a certain structure but the only thing absolute about all of them are the "_" (underscores). I'm trying to extract just the numbers between the underscores but I'm not having much luck. I'm trying two work with this Let function and was hoping for a little help. Right now it works to remove the first set of letter and the first underscore. I can't seem to get it to remove the last string and underscore. Let ( [ len = Length ( Lab_No ) ; pos = Position (Lab_No ; "_" ; 1 ;1) ; pos2 = Position (Lab_No ; "_" ; 1 ;2) ; pos2len = Length (Lab_No) - pos2 ] ; Right ( Lab_No ; len - pos ) ) I added pos2len but I'm not using it and I'm not sure I even need it. TIA.
October 7, 200916 yr Try: Let ( [ start = Position ( Lab_No ; "_" ; 1 ; 1 ) + 1 ; end = Position ( Lab_No ; "_" ; 1 ; 2 ) ] ; Middle ( Lab_No ; start ; end - start ) )
October 7, 200916 yr Author Thank you both very much. Each worked but I'll have to say after looking over the results of each calc the first solution with the Let, start end... discovered a few errors in the original Lab_No, which will help improve the quality of my data.
Create an account or sign in to comment