7

i am implemented this https://github.com/PDF417/pdf417-ios github for qr code scanning . i am getting response like this example i scanned two tickets, i am getting two different response bellow

  1. M1SOLLE/JOSUHUA EQHSLJX ATLMEMDL 0254 003Y28C 10C3JIJI7O4M28C,
  2. M1DEY/CHIRANJIB MR EPAELYA CCUBOM9W 0628 225Y018B0029 100.

how can i pick the:

1.flight number, 2.seatNumber, 3.date of journey 4.origin and destination.

is any available for direct library for parsing in ios??

Thank you for advance

Shivam Tripathi
  • 1,405
  • 3
  • 19
  • 37
Pramod Reddy
  • 126
  • 9

2 Answers2

5

For an explanation of the format, see page 28 of the IATA barcode standard. I'm not aware of any existing libraries to parse this, but search on GitHub. It should not be difficult to parse yourself, given the format.

Mike Taverne
  • 9,156
  • 2
  • 42
  • 58
4

I can help decipher the string.

M1SOLLE/JOSUHUA EQHSLJX ATLMEMDL 0254 003Y28C 10C3JIJI7O4M28C

The origin, destination, and airline can be found in the 8-character string, "ATLMEMDL". In this case Atlanta to Memphis on Delta Airlines" The first three letters are the origin airport code, the next three are the destination airport code, the last two are the airline code.

Airline codes can be found here. Airport codes can be found here.

The next set of four digits is the flight number, "0254", or flight 254.

The next chunk begins with a 3-digit sequence number for the date (January 3), the ticket class ("Y") and seat ("28C").

Similarly, the second example decodes as follows:

M1DEY/CHIRANJIB MR EPAELYA CCUBOM9W 0628 225Y018B0029 100

  • Origin: (CCU) Netaji Subhash Chandra Bose International Airport
  • Destination: (BOM) Chatrapati Shivaji International Airport
  • Airline: (9W) Jet Airways (India)
  • Date: (225) August 13
  • Flight: 628
  • Seat: 18B

I am not aware of an open source library for parsing this.=

picciano
  • 22,341
  • 9
  • 69
  • 82
  • thanks for helping, but how can i know the response before decoding if i get one format for every ticket i can but i scanned eight tickets i got different format how can write code for all those, i need to pick flight number and seat number and date of journey. there is no problem for picking origin and destination because we get every time 8 characters. – Pramod Reddy Apr 20 '18 at 17:27
  • You'll likely need to set up a token-based parser based on the document @mikeTaverne mentioned, this answer was just meant to help you decipher the string. – picciano Apr 20 '18 at 17:48