July 30, 200817 yr Newbies : I'm trying to extract certain bits of information stored on a membership card (control number) using a card reader so I can then do a lookup of name, address, etc. Currently, the info I see when I swipe the card is: %cardholder's name ? ;0416463 ? What I need is to be able to extract only the -046463 - and put it in a field. Does anyone know how to write the calculation ?
July 30, 200817 yr In FM9 the Filter function would make it easier. In FM6 you'd use other text functions: Middle(text, start, numberOfCharacters) Position(text, searchString, start, occurrence) Is the portion to extract always the same number of characters? I used 7 below, but you gave one example with 7 and one with 6. Middle( swipe; Position(swipe;";";1)+1; 7 )
July 30, 200817 yr How about: MiddleWords ( text ; 3 ; 1 ) This will work with any number of characters in the extracted string.
August 1, 200817 yr in my opinion, this would be the least chancy calculation: Left (Right (swipe ; Length (swipe) - (Position (swipe; " ? ;" ; 1 ; 1) +3)) ; Position ( Right (swipe ; Length (swipe) - (Position (swipe; " ? ;" ; 1 ; 1) +3)) ; " ?" ; 1 ; 1) - 1)
August 4, 200817 yr Author Newbies I appreciate the help. The only problem is that I'm too new to FM and don't really understand the reply. I tried to input the information you provided by received various errors like" field not defined", etc. So I would really need to know what fields need to be defined (and what type), and then what the calculation field to that reads the Card info. I guess what I'm trying to say is: I need a lot of help on this. Thanks for the reply - will continue to work until I can be it to read the data. Thanks again.
August 4, 200817 yr Well you need at least two fields - one would be a text field with the raw scanned input, and one a calculation field with the extracted portion. If the first field is named Input, then the formula for the second field can be = MiddleWords ( Input ; 3 ; 1 ) The result type needs to be set to Text. The other suggestions in the thread used the name "swipe" for the input.
Create an account or sign in to comment