May 13, 200520 yr I have a text string that is a file location. Its something like X:usersfreddocuments, or W:filesgeorgeshared. I want to extract the user name from the middle of that. The user names are all different lengths, and the locations are all different, so i can't use an exact length right/left function. I need to basically filter everything before the second slash and after the third. Any ideas.
May 13, 200520 yr Middle ( yourtext; Position ( yourtext; "" ; 1 ; 2 ) +1 ; Position ( yourtext; "" ; 1 ; 3 ) - Position ( yourtext; "" ; 1 ; 2 ) - 1 ) But I realized that this only works if the location is similiar, with a patterncount you could make it a bit more precise but not all the way....
May 13, 200520 yr Author The calculation does not appear to like the "". Its asking for another operator. Not sure how I would apply patterncount to this. Could you elaborate? Thanks!
May 14, 200520 yr The calculation works in v6, in order for it to work in v7, you have to escape the "", with a second this amended calculation works for the examples given. Middle( text; Position( text ; "" ; 1 ; 2 ) +1; Position( text ; "" ; 1 ; 3 ) - Position( text ; "" ; 1 ; 2 ) -1 ) Lee
May 14, 200520 yr MiddleWords(Substitute(Text; ""; " ");3;1) also works. edit: Though in the above spaces in a folder name would throw off the calculation. Substitute(MiddleValues(Substitute(Text; "";
Create an account or sign in to comment