Goal:
- Capture only the purchase date, amount, and purchased item name(s).
- Ignore all blank lines
- Ignore Reference # & SHIPPING AND TAX string
- Then, repeat this on the next grouping of purchases.
- I am using Google Sheets for this project.
Sample data showing 3 purchases (ie blocks of data)
Note: spacing & SHIPPING AND TAX string varies inbetween
01/12 P934200QXEHMBPNAD Acme MARKETPLACE SEATTLE WA $34.96 Date & Amount
Ignore (blank line)
435852496957 Ignore
BOSCH CO2135 1/8 In. x 2-3/4 I Purchased item name
BOSCH CO2131 1/16 In. x 1-7/8 Purchased item name
IZOD Men's Memory Foam Slipper Purchased item name
SHIPPING AND TAX Ignore
Ignore (blank line)
01/12 P934200QXEHMB6MQ0 Acme MARKETPLACE SEATTLE WA $48.91
492577232349
LxTek Remanufactured Ink Cartr
SHEENGO Remanufactured Ink Car
02/02 P934200AEHMB7E12 Acme MARKETPLACE SEATTLE WA $21.60
659473773469
LHXEQR Tubing Adapter for ResM
SHIPPING AND TAX
My updated attempt
=index(if(len(C26:C33),REGEXREPLACE(C26:C33,"(?Ums)(\d{2}/\d{2}) .* (\$\d{1,}\.\d{1,2}).(?:^\s+\d+$)(.*)(?:\s+SHIPPING AND TAX)","$1,$2,$3"),))
Unsuccessful results
01/12 P934200QXEHMBPNAD Acme MARKETPLACE SEATTLE WA $34.96
#VALUE!
BOSCH CO2135 1/8 In. x 2-3/4 I
BOSCH CO2131 1/16 In. x 1-7/8
IZOD Men's Memory Foam Slipper
SHIPPING AND TAX
01/12 P934200QXEHMB6MQ0 Acme MARKETPLACE SEATTLE WA $48.91
#VALUE!
LxTek Remanufactured Ink Cartr
SHEENGO Remanufactured Ink Car
02/02 P934200DJEHMB7E12 AMAZON MARKETPLACE SEATTLE WA $21.60
#VALUE!
LHXEQR Tubing Adapter for ResM
SHIPPING AND TAX
Unsuccessful
- it did not ignore:
data btwn date & amount
blank lines
SHIPPING AND TAX
- Value issue - not handling Reference # well
Function REGEXREPLACE parameter 1 expects text values. But '435848996957' is a number and cannot be coerced to a text.