Newbies Trapshooter Posted July 30, 2008 Newbies Posted July 30, 2008 : 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 ?
Fitch Posted July 30, 2008 Posted July 30, 2008 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 )
comment Posted July 30, 2008 Posted July 30, 2008 How about: MiddleWords ( text ; 3 ; 1 ) This will work with any number of characters in the extracted string.
databaser Posted August 1, 2008 Posted August 1, 2008 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)
Newbies Trapshooter Posted August 4, 2008 Author Newbies Posted August 4, 2008 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.
comment Posted August 4, 2008 Posted August 4, 2008 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.
Recommended Posts
This topic is 6343 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now