4 Replies Latest reply on Apr 9, 2017 11:20 AM by beverly

    Drivers Lic and ID Swipe

    dj1up

      So first I would like to thank any of you that can help me with this task.  I am trying to extract the data from a drivers lic and auto fill into my contacts table.  My 3 track mag swiper works great and gives me this to work with

       

      %CAFAIRFIELD^LASTNAME$FIRSTNAME$MIDDLENAME^STREET ADDRESS LINE1^?;636014025732536=130219790227?+!!94533      C              M511240BRNBRN            D62120040521  N['&QP0)<7=?

       

      I found this document on the format.  So getting the state data was easy with a Left calc., but that's where I scratch my head on where to go next. I think it will use the Middle and maybe Getvalue.  Not sure how to put it together tho.   All the areas in BLUE are areas that i need to extract.  Any thoughts or ideas would be great.

       


      Drivers License's Format
      Field LetterElement/DefinitionSize
      A

      Start Sentinel

      This Character must bed used at the beginning of the track.

      1
      B

      State of Province (addressee)

      (Mailing or Residential code)this field will use the ANSI D-20 standard

      2
      CCity

      This field should be truncated with a field separator ^ if less than 13 characters long. If a field separator is used, the "NAME" field follows immediately.

      EXAMPLE: Bear^

      13
      D

      Name

      This field should be truncated with a field separator ^ if less than 35 characters long. If a field separator is used. The "ADDRESS" field follows immediately. The $ symbol is to be used as a delimiter between names.

      EXAMPLE: Roe$Chery1$A^

      EXAMPLE using "City and Name"

      Bear^Roe$Chery1$A^

      at this point a total of 19 bytes have been used, allowing the remainder to be used for the address.

      35

      E

      Address

      This field has a minimum length of 29 which can be exceeded when utilizing the space from either the city and/or name field. The $ symbol can be used a as delimiter of multiple address lines.

      EXAMPLE: Using the City, Address

      Combination: Bear^Roe$Chery1$A^123 Something St^

      29
      F

      End Sentinel

      This character must be the next to the last character of the track.

      1

      G

      LRC

      This character must be used at the end of the track.

      1

       

       

      Track2 Format:

      Field LetterElement/DefinitionSize
      A

      Start Sentinel

      This character must be used at the beginning of the track.

      1
      B

      ANSI User Code

      This field is assigned by ANSI for the utilization of Track2

       

      1
      C

       

      ANSI User ID

      This field is the assigned identification number from ISO (International Standards Organization).

      5
      D

      Jurisdiction ID/DL Number

      This field is used to represent the ID/DL number assigned by each jurisdiction. If less than 13 bytes are used the field is truncated by a field separator character. If 13 bytes are used the field separator character MUST appear in the 14th position. Overflow can be accommodated in field letter g.

      14
      E

      Expiration Date

      This field will be represented in the following format YYMM.

      4
      F

      Birthdate

      This field will be represented in the ANSI D-20 Standard YYYYMMDD

      8
      G

      Remainder of Jurisdictional ID/DL

      This field is used to handle the overflow from the jurisdiction ID/DL field.

      5
      H

      End Sentinel

      This character must be the next to the last character of the track.

      1
      I

      LRC

      This character must be used at the end of the track.

      1

       

       

      Track3 Format:

      Field LetterElement/DefinitionSize
      A

      Start Sentinel

      This character must be used at the beginning of the track.

      1
      B

      Template Version#

      1 byte table, value 01-63, this field will be used to store the magnetic stripe version being used. It will be necessary to register the use with AAMVA.

      1
      C

      Security Version #.

      1 byte table, value 01-63, this field will be used to store the magnetic stripe security version used. 00 represents security is not used.

      1
      D

      Postal Code

      This field will be used to store an 11 position Zip Code or the Canadian postal code. 11 Alphanumeric digits will soon be required to meet postal standards. Left justified with spaces filled. Use no hyphens.

      11
      E

      Class

      This field will be alphanumeric and will represent the type of license. Use ANSI D-20 codes as modified for CDLIS.

      2
      F

      Restrictions

      This field will be alphanumeric and will use the ANSI D-20 standard.

      10
      G

      Endorsements

      This field will be alphanumeric and will use the ANSI D-20 standard.

      4
      H

      Sex

      Represent as alphanumeric

      1
      I

      Height

      Represent as numeric. See ANSI D-20

      3
      J

      Weight

      Represent as numeric. See ANSI D-20

      3
      K

      Hair Color

      Represent as alphanumeric. See ANSI D-20

      3
      L

      Eye Color

      Represent as alphanumeric. See ANSI D-20

      3
      MThis field can be utilized by each jurisdiction as needed, but if used it will be necessary to register the use with AAMVA10
      N

      Reserved Space

      This field can be utilized by each jurisdiction as needed, but if used it will be necessary to register the use with AAMVA

      16
      O

      Error Correction

      This field can be utilized by each jurisdiction, but is not a mandatory field.

      6
      P

      Security

      This field is for the use of each jurisdiction.

      5
      Q

      End Sentinel

      This character must be the next to the last character for the track.

      1
      R

      LRC

      This character must be used at the end of the track.

      1
        • 1. Re: Drivers Lic and ID Swipe
          beverly

          You have a mixture of fixed and delimited. Study the mapping you have provided. It it says 1 character, than 1 it is. Name is 35 OR delimited if less than 35, etc. 

           

          Sent from miPhone

          • 2. Re: Drivers Lic and ID Swipe
            philmodjunk

            I have a solution that I worked out over a number of years and a lot of license swipes. It's not one that I can just give away.

             

            Send me a message if you like to purchase a sample file with the scripts etc. included.

            • 3. Re: Drivers Lic and ID Swipe
              dj1up

              Thank you for the insite Beverly.  I to had come to this conclusion.  I have been trying to find videos or post about fixed values and delimited vales and how to parse them out but nothing so far.  Can you elaborate a little more on my next step?  Thank you again.

              • 4. Re: Drivers Lic and ID Swipe
                beverly

                these functions are extremely helpful with "parsing":

                PatternCount()

                Position()

                Middle()

                (and Right & Left)

                Length()

                 

                you can "chunk" by testing first for the Middle of each part and if the other characters are in that "chuck", then revert to the instructions for separators.

                example, track1, script and/or use Let():

                $pos = 1 // index starts at 1

                 

                $size = 1 // initial length to grab

                $A = Middle ( DL ; $pos ; $size ) // size = 1

                $pos = $pos + $size // (move the pointer)

                 

                $size = 2 // new length

                $B = Middle( DL ; $pos ; $size ) // starting with 2nd character, grab two

                $pos = $pos + $size // (move the pointer)

                 

                $size = 13

                $C = Middle( DL ; $pos ; $size ) // starting with 4th character, grab 13

                /* here is where we test for "^" in that chunk */

                If ( PatternCount ( $C ; "" ) ; $size = Position ( $C ; "" ; 1 ; 1 ) - 1 // exclude the char)

                $C = Middle( DL ; $pos ; $size ) ) // grab 13 or grab up to the "^"

                $pos = $pos + $size // (move the pointer)

                 

                $size = 35

                $D =

                /* It gets a little more complex with the "$" separator, but using the same 'logic', above, you can extract what you need for those to be separate as well */

                ....

                HTH!

                beverly