View Single Post
  #1  
Old May 25th, 2018, 06:43 AM
ricky10ss ricky10ss is offline
Junior Community Member
 
Join Date: Mar 2009
Posts: 35
Default Parse data to determine page and extract data

Attached is a sample data file with Slot1 - Slot68. Each slot could be a voucher or Coupon. The attached image shows what they are trying to do. The first character determines if the page selected is a coupon, voucher or blank. If a voucher then the next three character are the voucher number like SLOT35 in the sample data V203.

If a coupon then the 2-3 character is the coupon code, 4-5 is the Service Type code, 6-11 in the mileage, and 12-15 is the value. Would need to parse each out to include the data into the coupon.

Anyone have an idea on how to parse this out via Javascript? I could then turn on and off pages based on the it being a coupon, what version of coupon and/or if blank.
Attached Images
File Type: png Code example.png (27.5 KB, 8 views)
Attached Files
File Type: txt Sample_Data.txt (1.1 KB, 3 views)
Reply With Quote