Parse quantity and price out of receipt lines
Receipt lines arrive from the tills as one text blob per item, in the form 2x MILO 3in1 400g @ 12.90 — a quantity, then x, then the product description, then @ and the unit price.
Split each line into its parts and work out what each one came to.
Return receipt_id, the parsed product with no surrounding whitespace, qty, unit_price, and line_total (quantity times unit price).
Schema
| receipt_id | INT |
| raw_line | TEXT |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime