December 27, 200718 yr Purpose: Grab all of the field starting at the first number. Examples are: CSR2400882A (result should be 2400882A) 3266427 (result should be 3266427) CHSZzSTVa241CRMC (result should be 241CRMC) Here's what I currently have (result is text) Let ( [ num = Substitute ( text ; [ 0 ; "~" ] ; [ 1 ; "~" ] ; [ 2 ; "~" ] ;[ 3 ; "~" ] ; [ 4 ; "~" ] ; [ 5 ; "~" ] ; [ 6 ; "~" ] ; [ 7 ; "~" ] ; [ 8 ; "~" ] ; [ 9 ; "~" ] ) ; pos = Position ( num ; "~" ; 1 ; 1 ) ] ; Right ( text ; Length ( text ) - pos + 1 ) ) ... I know, I know ... but I couldn't figure out how to best approach it (obviously). I could also use Middle ( text ; pos ; Length ( text )) but can I eliminate the substitution portion to identify each number? That part is so long and ugly! Sometimes my brain can't find elegance if it slapped me on the forehead! UPDATE: I originally had the string in rows down the page but I thought it wouldn't look so twisted if it was all together. It still looks twisted. LaRetta Edited December 27, 200718 yr by Guest Added update
December 27, 200718 yr Author Let ( [ num = Substitute ( text ; [ 0 ; 1 ] ; [ 1 ; 1 ] ; [ 2 ; 1 ] ;[ 3 ; 1 ] ; [ 4 ; 1 ] ; [ 5 ; 1 ] ; [ 6 ; 1 ] ; [ 7 ; 1 ] ; [ 8 ; 1 ] ; [ 9 ; 1 ] ) ; pos = Position ( num ; 1 ; 1 ; 1 ) ] ; Right ( text ; Length ( text ) - pos + 1 ) ) Okay, changing the tilde to a 1 makes it smaller but it STILL looks twisted. Please save me from myself ... I KNOW I should be able to combine those numbers and find the starting position of them in one whack (and without a CF), right? Edited December 27, 200718 yr by Guest Changed sentence
December 27, 200718 yr Hello, Perhaps with "Filter" ? let ([ Num = Filter ( Text ; "0123456789" ) ; Pos = Position ( Text ; Left ( Num ; 1 ) ; 1 ; 1 ) ]; Middle ( Text ; Pos ; Length ( Text ) ) ) Agnes
December 27, 200718 yr Author Of Course!! Thank you! It felt like the easy answer was on the tip of my tongue and I just couldn't find it! DOH! Thanks for putting me out of my misery, Agnes! :waytogo:
Create an account or sign in to comment