4 Replies Latest reply on Jan 3, 2014 3:17 PM by JimmyMadison

    Magnetic Card Reader

    JimmyMadison

      I have a file which I need to populate AL Drivers License information into. I am using a Magtek card reader which I have working well and storing the card string into a text field. Listed below is an dummy example of the data that is stored in the field:

       

      %ALARLEY^LAST_NAME$FIRST_NAME$M_NAME^1169 COUNTY ROAD 4221^?;6360333096123=150719530806=?#10355412379 DM M511205BROBLU?

       

      The blank space in front of the "DM" and after all apear to be just blank space.

       

      I have read the Left, Right, and Middle calulations and it has me very confused. Can someone please send me in the right direction on how to populate the above string into seperate fields such as First_Name, M_Name,Last_Name, Address, and so on. Thanks for your assistance. JM

        • 1. Re: Magnetic Card Reader
          jrenfrew

          try a script which starts by stepping through each bit of information one at a time substituting a break character for a carriage return. You get one or more value followed by the remainder

           

          so

          set variable $a = substitute ( text ; "^" ; ¶ )

          giving

          %ALARLEY

          LAST_NAME$FIRST_NAME$M_NAME

          1169 COUNTY ROAD 4221

          ?;6360333096123=150719530806=?#10355412379  DM              M511205BROBLU?

           

          the first value will be right ( getvalue ( $a ; 1 ) ; length ( getvalue ( $a ; 1 )  ) - 1 )

          set variable $b = substitute ( getvalue ( $a ; 2 ) ; "$" ; ¶ )

          last will be getvalue ( $b ; 1 )

          first will be getvalue ( $b ; 2 )

          m will be getvalue ( $b ; 3 )

           

          gives you the chance to see the results each time you substitute

           

          no idea what the meaning of the rest is but you get the gist presumably?

           

          john

          • 2. Re: Magnetic Card Reader
            beverly

            And there is the Position() function that often can be used. It can find the character(s) that are always the same, starting from the left or the right of a string (any number) and the occurrence of a pattern of character(s) within the string. This function can be used inside of the Left(), Middle() or Right() functions.

             

            Length() and PatternCount() are two other functions used when I am "parsing".

             

            Any of the "list" (value) functions are great, but sometimes you can't exchange the very character(s) for which you are searching. Use all of these functions and you have a very powerful parser. Until we get a GREP function (natively), use what you're given!

             

            John's advice of stepping through each bit is also advised. Once you have the pattern perfected, you may combine into fewer steps. Setting the variables allows you to see each chunk in Data Viewer if you are working in FMP Advanced.

             

            -- sent from my iPhone4 --

            Beverly Voth

            --

            • 3. Re: Magnetic Card Reader
              TimGriffith

              Mag stripe tracks begin with '%' [track1], ';' [track2] and '#' [track3] always end with a question mark (?). Anything beyond those sentinell boundaries is junk. And the %;#? characters are not allowed in the tracks, so if you substitute a carriage return for the question marks you can see all three tracks as separate lines. I wrote a custom function a long time ago for working with mag stripe data... http://www.briandunning.com/cf/708

              • 4. Re: Magnetic Card Reader
                JimmyMadison

                Thanks to everone, sorry for late getting back to this post. Holidays are over and back to the grind. I have the card reader working fine now. Thanks again.