Abhijith Ea
Abhijith Ea

Reputation: 385

How to extract substring from a string effectively

I was scraping site and want extract the quantity and quantity type,

The quantity and quantity type is not given separately it is given with the title of the products since the title is not following any kind of pattern i can't figure out a way to extract the quantity and quantity type

Here is the some examples of the names are given

  1. "7-Up Soda – 24/12 oz cans"
  2. "A&W Root Beer, 12 oz cans, 12 pack"
  3. "Aldi Milk-15 gallon"
  4. "Arizona – Arnold Palmer, Iced Tea & Lemonade – 24/23 oz cans"
  5. "Balle Balle- Kesar Mango Pulp – case"

Here the strings are not following any kind of pattern, like first name is separated with "–", second is separated with ",", third string is with "-" and fifth one don't have any quantity or quantity type

That is the names not following any kind of patterns

This is the code i tried to separate the quantity and quantity type

   product_names = ['7-Up Soda – 24/12 oz cans', '7-Up Soda – 8/2L plastic bottles', 'A&W Root Beer – 24/12 oz cans', 'A&W Root Beer, 12 oz cans, 12 pack', 'Abuelita – Hot Cocoa Mix – 6/2 lbs Bag', 'Acqua Panna Spring Water – 24/.5 L plastic bottles', 'Acqua Panna Water – 12/1L glass bottles', 'Aldi Milk-15 gallon', 'Arizona – Arnold Palmer, Iced Tea & Lemonade – 24/23 oz cans', 'Arizona – Fruit Punch – 24/23 oz cans', 'Arizona – Grapeade – 24/23 oz cans', 'Arizona – Green Tea – 24/23 oz', 'Arizona – Kiwi-Strawberry – 24/23 oz cans', 'Arizona – Lemonade – 24/23.5 oz cans', 'Arizona – Mucho Mango – 24/23 oz cans', 'Arizona – Rx Energy, Herbal Tonic- 24/23 oz cans', 'Arizona – Southern Style – Sweet Tea – 24/23 oz cans', 'Arizona – Watermelon Juice Drink – 24/23 oz cans', 'Arizona Half Iced Tea & Half Mango – 24/23.5 oz cans', 'Bai – Brasilia Blueberry – 12/18 oz bottles', 'Bai – Molokai Coconut – 18 oz', 'Balle Balle- Kesar Mango Pulp – case', 'Bang – Candy Apple Crisp, 16 oz, 12 Pk', 'Bang – Cotton Candy Energy Drink – 12/16 oz', 'Bang – Lemon Drop Energy Drink – 12/16 oz', 'Bang – Peach Honey Energy Drink – 12/16 oz', 'Bang – Pear Guava Energy Drink – 12/16 oz', 'Bang – Rainbow Unicorn Energy Drink – 12/16 oz', 'Bang – Sour Heads Energy Drink – 12/16 oz', 'Bang – Star Blast Energy Drink – 12/16 oz', 'BANG BLUE RAZZ 16Z', 'BANG BLUE RAZZ 16Z', 'Barq’s Root Beer – 2.5 gallon bag-in-box syrup', 'Big Geyser – Core Water – 1 Liter', 'Big Train – Mocha Blended Ice Coffee Mix – 3.5 lb', 'Bonnie – Chocolate Syrup – gallon', 'Bonnie – Fruit Punch Syrup, 7+1 – gallon', 'Bonnie – Grape Syrup, 7+1 – gallon', 'Bonnie – Lemonade Syrup, 7+1 – gallon', 'Bonnie – Orange Syrup, 7+1 – gallon', 'Bundaberg – Peach – 12.7 oz', 'Callebaut – High Fat Cocoa Powder, 22-24% – 4lb Bags', 'Calypso – Black Cherry Lemonade – 12/16 Oz', 'Calypso – Blue Lemonade – 16 Oz', 'Calypso – Original Lemonade – 12/16 Oz', 'Calypso – Peach Tea & Lemonade – 12/16 Oz', 'Calypso – Strawberry Lemonade – 16 Oz', 'Calypso – Triple Melon Lemonade – 12/16 Oz', 'Canada Dry – Ginger Ale – 24/12 oz cans', 'Canada Dry Club Soda – 24/12 oz cans', 'Canada Dry Tonic Water – 24/12 oz cans', 'Carnation Malted Milk – 2.5 lbs', 'Chakoah – Coconut Milk – 24/13 oz cans', 'Chef’s Quality – 100% Columbian Coffee – 1 lb pkgs', 'Chef’s Quality – Cocoa Powder – 5 Lb', 'Chef’s Quality – Colombian Ground Coffee – 42/2 oz Packets', 'Chef’s Quality – Columbian Decaffeinated Coffee – 42/2 oz Packet', 'Chef’s Quality – Donut Shop Blend – 2lb. Bag', 'Chef’s Quality – Lemon Juice – 32 oz Bottle', 'Chef’s Quality – Lemon Juice – gallon', 'Chef’s Quality – Lime Juice – 32 oz Bottle', 'Chef’s Quality – Lime Juice – gallon', 'Chef’s Quality – Roaster Reserve Blend Coffee – 36 ct', 'Chef’s Quality – Whole Bean Colombian Coffee – 2.5 lb Bag', 'Chef’s Quality Hotel & Restaurant Blend Coffee – 34.5 oz', 'Cherry Coke – 2.5 gallon bag-in-box syrup', 'Coca-Cola – 2.5 gallon bag-in-box syrup', 'Coca-Cola – 5 gallon bag-in-box syrup', 'Coca-Cola Bottles, 16.9 fl oz, 24 Pack', 'Coca-Cola Bottles, 2 Liters, 4 Pack, 2 Sets', 'Coca-Cola Cans, 12 fl oz, 35 Pack', 'Coca-Cola Cans, 16 fl oz, 24 Pack', 'Coca-Cola Cans, 7.5 fl oz, 4 Pack', 'Coca-Cola Energy Cans, 12 fl oz, 24 Pack', 'Coca-Cola Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Coca-Cola Mexico Glass Bottles, 355 mL, 6 Pack, 4 Sets', 'Coca-Cola Zero Sugar Cans, 12 fl oz, 35 Pack', 'Coco Lopez – Cream of Coconut – 15 oz', 'Coco Lopez – Cream of Coconut – 15 oz', 'Coco Lopez – Cream of Coconut – 57 oz Can', 'Coffee mate – French Vanilla Creamer Pump – 1.5 Ltr', 'Coffee mate – Hazelnut Creamer Pump- 1.5 Ltr', 'Coffee mate – Original Creamer Pump – 1.5 Ltr', 'Coffee mate – Original Liquid Creamer Cups – 180 Ct', 'Coffee mate Creamer, Snickers Flavor – 50 ct', 'Coke Classic, 20 oz bottles – 24 ct', 'Coke Zero – 2.5 gallon bag-in-box syrup', 'Country Time Lemonade – packet makes 2 gallons', 'Crush – Strawberry Soda – 24/12 oz cans', 'Crush Grape Soda – 24/12 oz cans', 'Daily’s – Lime Juice – 1 ltr Bottle', 'Daily’s – Margarita Mix – 1 ltr Bottle', 'Daily’s – Margarita Mix – 64 oz Bottle', 'Daily’s – Peach Daiquiri Mix – 64 oz bottle', 'Daily’s – Pina Colada Mix – 64 oz bottle', 'Daily’s – Raspberry Daiquiri – 64 oz bottle', 'Daily’s – Simple Syrup – 1 ltr Bottle', 'Daily’s – Sour Mix – gallon Bottle', 'Daily’s – Strawberry Daiquiri Mix – 1lr Bottle', 'Daily’s – Strawberry Daiquiri Mix – 64 oz Bottle', 'Daily’s – Sweet & Sour Mix – 1 ltr Bottle', 'Daily’s – Sweet & Sour Mix – 64 oz bottle', 'Daily’s – Triple Sec Syrup – 32 oz bottle', 'DASANI Purified Water Bottles, 20 fl oz, 24 Pack', 'Delicia – Jamaica Drink Concentrate – 32 oz', 'Delicia – Tamarind Drink Concentrate – 32 oz lb', 'Diet 7-Up, 12 oz cans, 24 pack', 'Diet Coke – 2.5 gallon bag-in-box syrup', 'Diet Coke – 5 gallon bag-in-box syrup', 'Diet Coke Bottle, 20 fl oz – 24 ct', 'Diet Coke Bottles, 16.9 fl oz, 24 Pack', 'Diet Coke Bottles, 2 Liters, 4 Pack, 2 Sets', 'Diet Coke Cans, 12 fl oz, 35 Pack', 'Diet Coke Cans, 7.5 fl oz, 10 Pack, 3 Sets', 'Diet Coke Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Diet Pepsi – 2 Ltr', 'Diet Pepsi – 35/12 oz', 'Diet Pepsi Cube – 36/12 oz cans', 'Dole – Pineapple Juice – 24/8.4 oz cans', 'Dole – Pineapple Juice – 46 oz cans', 'Dole – Pineapple Juice – 48/6 oz cans', 'DominAde – Fruit Punch Mix – 12/21.6 oz', 'DominAde Drink Mix- Lemon- 12/21.6 oz pouch', 'DominAde Drink Mix- Pink Lemonade – 12/21.6 oz pouch', 'Dr.Pepper – 24/12 oz cans', 'Dr.Pepper – 24/20 oz plastic bottles', 'Dr.Pepper – 8/2L plastic bottles', 'Essentia Water – 12/1 Ltr', 'Essentia Water – 24/20 oz', 'Evon’s – Malt Liquid – 4/1 gallon', 'Evon’s – Neutral Slush Syrup – gallon', 'Evon’s – Sour Lemon Bar Mix – gallon', 'Evon’s – Sweet & Sour Mix – gallon', 'Fanta – Orange Soda – 24/20 oz', 'Fanta Orange – 2.5 gal bag in box syrup', 'Fanta Orange Mexico Glass Bottles, 355 mL, 4 Pack, 6 Sets', 'Fanta Orange Soda Bottles, 2 Liters, 8 Pack', 'Fanta Orange Soda Cans, 12 fl oz, 24 Pack', 'Fiji – Water – 700 ml', 'Fiji Water – 11.2 oz plastic bottles', 'Fiji Water – 12/1L plastic bottles', 'Fiji Water – 24/0.5L bottles', 'Finest Call – Bloody Mary Mix – 1 ltr Bottle', 'Finest Call – Grenadine – 1 ltr Bottle', 'Finest Call – Lime Sour Mix – 1 Liter', 'Finest Call – Mango Puree Mix – 1 ltr Bottle', 'Finest Call – Margarita Mix – 1 ltr Bottle', 'Finest Call – Passion Fruit Puree Mix – 1 ltr Bottle', 'Finest Call – Peach Puree Mix – 1 ltr Bottle', 'Finest Call – Pina Colada Mix – 1 ltr Bottle', 'Finest Call – Pomegranate Mix – 1 ltr Bottle', 'Finest Call – Raspberry Puree Mix – 1 ltr Bottle', 'Finest Call – Strawberry Puree Mix – 1 ltr Bottle', 'Finest Call – Sweet & Sour Mix – 1 ltr Bottle', 'Finest Call – Triple Sec Syrup – 1 ltr Bottle', 'Finest Call – Watermelon Puree Mix – 1 ltr Bottle', 'Foco – Coconut Juice – 24/11.8 oz cans', 'Foco – Coconut Juice – 24/17.6 oz cans', 'Folger’s – Classic Roast Ground Coffee – 48 oz', 'Folger’s – Classic Roast Ground Coffee Packets – 42/1.2 oz packets', 'Folger’s – Classic Roast Ground Coffee Packets – 42/1.2 oz packets', 'Folger’s Coffee – Classic Decaffeinated – 30.5 oz', 'Fuze – Sweet Tea – 2.5 Gal', 'Gatorade – All Star Core Variety Pack – 28/12 oz plastic bottles', 'Gatorade – All Star Original Variety Pack – 28/12 oz plastic bottles', 'Gatorade – All Star Original Variety Pack – 28/12 oz plastic bottles', 'Gatorade – Cool Blue – 24/20 oz plastic bottles', 'Gatorade – Fruit Punch- 24/20 oz plastic bottles', 'Gatorade – Lemon Lime Flavor – 24/20 oz bottles', 'Gatorade – Orange – 24/20 oz plastic bottles', 'Gatorade – Thirst Quencher, Sports Drinks Core Variety Pack, 12 oz, 28 Ct', 'Gatorade Zero Variety Pack – 28/12 oz', 'Ghirardelli – Caramel Sauce – 64 oz Bottle', 'Ghirardelli – Chocolate Cocoa Sauce – 64 oz', 'Ghirardelli – Hot Fudge Sauce – #10 can', 'Ghirardelli – Hot Fudge Squeeze Bottle – 23 oz', 'Gold Peak Sweetened Black Tea Bottle, 18.5 fl oz', 'Gold Peak Unsweetened Black Tea Bottle, 18.5 fl oz', 'Golden – Pomegranate Molasses – 10 oz', 'Gosling’s – Ginger Beer – 24/12 oz', 'Goya – Mango Nectar – 24/9.6 oz cans', 'Hawaiian Punch- 24/12 oz cans', 'Hershey’s Bulk Dutch Cocoa Powder, 10-13% – 25 lbs', 'Hiko – Carrot Apple/Peach – 750 Ml', 'Hiko – Carrot Nectar – 750 Ml', 'Honest Tea Half Tea & Half Lemonade Bottles, 16.9 fl oz, 12 Pack', 'Honest Tea Honey Green Bottles, 16.9 fl oz, 12 Pack', 'IBC – Cream Soda – 6/4 Pk', 'IBC – Root Beer with Real Sugar – 12 Oz, 24 ct', 'Ice Mountain – Natural Spring Water – 15/1L', 'Ice Mountain – Natural Spring Water – 28/20 oz', 'Ice Mountain Spring Water – 40/0.5 L oz plastic bottles', 'Ice Mountain- Distilled Water – 6/1 gal plastic bottles', 'Ice Mountain- Natural Spring Water with Flip cap – 24/23.6 oz bottles', 'Ice Mountain- Spring Water – 48/8 oz plastic bottles', 'Ice Mountain- Spring Water – 6/1 gal plastic bottles', 'Jarritos – Fruit Punch Soda – 24/12.5 oz glass bottles', 'Jarritos – Fruit Punch Soda – 24/16.9 oz plastic bottles', 'Jarritos – Glass Variety Pack – 24/12 oz', 'Jarritos – Grapefruit Soda – 24/12.5 oz glass bottles', 'Jarritos – Lime Soda – 24/12.5 oz glass bottles', 'Jarritos – Lime Soda – 24/500ml', 'Jarritos – Mandarin Soda – 24/12.5 oz glass bottles', 'Jarritos – Mandarin Soda – 24/500ml', 'Jarritos – Mandarin Soda – 8/1.5L plastic bottles', 'Jarritos – Mango Soda – 24/12.5 oz glass bottles', 'Jarritos – Mineragua (Club Soda)- 24/12.5 oz glass bottles', 'Jarritos – Mineragua (Club Soda)- 24/500ml bottles', 'Jarritos – Mineragua (Club Soda)- 8/1.5.L plastic bottles', 'Jarritos – Pineapple Soda – 24/12.5 oz glass bottles', 'Jarritos – Pineapple Soda – 24/500ml', 'Jarritos – Strawberry Soda – 24/12.5 oz glass bottles', 'Jarritos – Tamarind Soda – 24/12.5 oz glass bottles', 'Jarritos – Tamarind Soda – 8/1.5L plastic bottles', 'Jarritos – Tamarindo Soda – 24/500ml', 'Jarritos – Variety Pack, 500 ml – 24 ct', 'Jero – Sweet & Sour Mix Syrup – 4/1 gallon', 'Jumex – Nectar Variety Pack – 24/11.3 oz', 'Karo – Dark Corn Syrup (Blue Label) – gallon', 'LaCroix – Grapefruit Sparkling Water -2/12 pack', 'LaCroix – Lemon Sparkling Water – 24/12 oz', 'LaCroix – Lime Sparkling Water – 24/12 oz', 'LaCroix – Mango Sparkling Water – 24/12 oz cans', 'LaCroix – Passion Fruit Sparkling Water – 2/12 Pack', 'LaCroix – Peach Pear Sparkling Water – 24/12 oz', 'LaCroix – Plain Sparkling Water – 24/12 oz', 'LaCroix – Tangerine Sparkling Water – 24/12 oz', 'Lavazza – Decaf Espresso – 1.1 Lb', 'Lavazza – Espresso in Blu Coffee Tins – 8.8 oz', 'Lavazza – Gran Espresso – 2.2 Lb', 'Lavazza – Italian Roast Drip Coffee Grounds – 30/2.25 oz', 'Lavazza – Quality Rossa – 2.2 lb', 'Lavazza – Super Crema Espresso Coffee Beans – 2.2 lbs', 'Lipton – Auto Brew Regular Flavored Tea Bags – 24/3 oz', 'Lipton – Green Tea – 100 Ct', 'Lipton – Iced Tea Bags – 24 ct', 'Lipton – Original Flavored Regular Tea Bags – 100 ct', 'Lipton Brisk – 36/12 oz cans', 'Little Hug – Variety Pack – 40/8 oz', 'Malta India – Non Alcoholic Malt Beverage – 24/7 oz', 'Manzanita Sol – Apple Soda – 24/12 oz can', 'Manzo – Mango Nectar – 1L', 'Master of Mixes – Margarita Salt – 8 oz pkgs', 'Maxwell House – Original Ground Decaf Coffee – 29 oz', 'Maxwell House Original Ground Coffee – 30.6 oz', 'Mexican 7-Up In Glass Bottle – 12 Ct', 'Mexican Squirt- Citrus Soda – 12/12 oz glass bottles', 'Minute Maid – Lemonade – 2.5 gallon bag-in-box syrup', 'Minute Maid Orchard’s Best Cranberry Juice Cocktail – 2.5 gallon bag-in-box', 'Mistic – Bahama Blueberry Drink – 24/16 oz glass bottles', 'Mistic – Lotta Colada Drink – 24/16 oz glass bottles', 'Mistic – Orange Carrot Drink – 12/16 oz glass bottles', 'Mistic – Strawberry Grape Drink – 24/16 oz glass bottles', 'Mistic – Strawberry Kiwi Drink – 24/16 oz glass bottles', 'Mistic -Tropical Fruit Punch- 24/16 oz glass bottles', 'Monster – Java Coffee Mean Bean & Loca Moca – 15 OZ', 'Monster – Ultra Paradise Energy Drink – 24/16 oz', 'Monster Assault – 16 Oz', 'Monster Energy Drink – 24/16 oz cans', 'Monster Energy Drink – Absolutely Zero – 24/16 oz cans', 'Monster Energy Drink – Low-Carb- 24/16 oz cans', 'Monster Energy Drink – Mega – 12/24 oz cans', 'Monster Energy Drink – Ultra Sunrise – 24/16 oz cans', 'Monster Energy Drink – Zero Ultra – 24/16 oz cans', 'Monster Energy Drink -Java Monster (Loco Moca)- 12/15 oz cans', 'Monster Energy Drink -Java Monster (Mean Bean)- 12/15 oz cans', 'Monster Energy Ultra Variety Pack – 24/16 oz', 'Mott’s – Apple Juice – 8/64 oz plastic bottles', 'Mott’s – Apple Juice -24/8 oz plastic bottles', 'Mott’s – Apple Juice Minis – 4 Pk', 'Mott’s – Clamato Juice – 1L plastic bottle', 'Mott’s – Clamato Juice – 24/5.5 oz cans', 'Mott’s – Fruit Punch Mini Juice Box – 4 Pk', 'Mott’s Apple Juice – 24/10 oz glass bottles', 'Mott’s Apple Juice – gallon', 'Mott’s Apple Juice – gallon', 'Mott’s Clamato Juice – 12/32 oz plastic bottles', 'Mott’s Clamato Tomato Cocktail – 2/64 oz plastic bottles', 'Mott’s Spicy Clamato Juice (Picante) – 12/32 oz plastic bottle', 'Mountain Dew – 24/20 oz bottles', 'Mountain Dew – 8/2L bottles', 'Mountain Dew Cube – 36/12 oz cans', 'Mr Pure – Orange Juice – 10 Oz', 'Mr. & Mrs. T – Bloody Mary Mix – 1 ltr Bottle', 'Mr.Pure – Cranberry Juice – 6/64 oz plastic bottles', 'Mr.Pure – Orange Juice – 6/64 oz plastic bottles', 'Naked – Green Machine Juice – 15.2 Oz', 'Naked – Mighty Mango – 15.2 Oz', 'Naked Juice – Blue Machine – 8/15.2 oz', 'Naked Juice – Red Machine – 15.2 Oz', 'Nantucket Nectars – Orange – 24/16 oz glass bottles', 'Nesquik – Chilled Strawberry Beverage – 12/14 oz', 'Nesquik – Chocolate Ready to Drink Beverage – 12/14 oz', 'Nesquik – Vanilla Drink – 12/14 oz', 'Nesquik – Vanilla Drink – 12/14 oz', 'Nestle Pure Life – Purified Water – 35/0.5L plastic bottles', 'Nestle Pure Life – Purified Water – 48/8 oz plastic bottles', 'Nestle Pure Life Water – 24/24 oz plastic bottles', 'Nestle Water – Acqua Panna – 12/750 Ml', 'Nestle Water – NPL Purified – 20 Oz', 'Nestle Whipper Mix – 2 lbs', 'Ocean Spray – 100% Orange Juice – 48/5.5 oz cans', 'Ocean Spray – 100% Orange Juice, Bar Pack – 32 oz Bottle', 'Ocean Spray – 100% White Grape Juice – 48/5.5 oz cans', 'Ocean Spray – Cranberry Juice Cocktail – 48/5.5 oz', 'Ocean Spray – Cranberry Juice Cocktail – 60 oz', 'Ocean Spray – Cranberry Juice Cocktail Bar Pack – 12/32 oz Bottle', 'Ocean Spray – Ruby Red Grapefruit Juice – 60 oz', 'Ocean Spray – White Grapefruit Juice – 12/32 oz Bottle', 'Ocean Spray- Apple Juice – 48/5.5 oz cans', 'Ocean Spray- Cranberry Juice Cocktail – 8/64 oz plastic bottles', 'OKF – Aloe Vera, Fruit Punch – 12/16.9 Oz', 'OKF – Organic Aloe Drink – 12/16.9 oz', 'OKF – Red Smoothie – 16.9 OZ', 'OKF – Yellow Smoothie – 16.9 Oz', 'Orange Crush Cube – 24/12 oz cans', 'Orange Crush Soda – 24/20 oz bottles', 'Oregon Chai Tea Concentrate – 32 oz', 'Parks – Pomegranate Juice – 1 Liter', 'Pepsi – Cola Cube Pack – 36/12 oz cans', 'Pepsi – Diet 20 oz', 'Pepsi Cola – 24/20 oz bottles', 'Pepsi Cola – 8/2L plastic bottles', 'Pepsi Cola (Mexican) – 24/12 oz glass bottles', 'Perrier – Sparkling Mineral Water – 24/11 oz glass bottles', 'Perrier – Sparkling Mineral Water – 24/16.9 oz plastic bottles', 'Pibb Xtra Soda – Syrup 2.5 gal bag-in-box', 'Pocas – Mango Nectar – 8.5 Oz', 'Pocas – OKF Farmers Aloe Original – 50.4 Oz', 'Pocas International – OKF Farms Aloe Watermelon – 16.9 Oz', 'Pocas OKF – Aloe Mango – 16.9 Oz', 'Pocas OKF – Farm Aloe CoCo – 16.9 Oz', 'Pocas OKF – Farm Aloe Pomegranate – 16.9 Oz', 'Pocas OKF – Farm Aloe Strawberry – 16.9 Oz', 'Pocas OKF – Farmers Aloe Pineapple – 16.9', 'Pocasville – Guava Nectar – 8.5 Oz', 'Pocos – Oak Farm Original Aloe Drink – 12/16.9 oz', 'POWERADE Fruit Punch Bottles, 28 fl oz, 15 Pack', 'POWERADE Lemon Lime Bottles, 28 fl oz, 15 Pack', 'POWERADE Mountain Berry Blast Bottles, 20 fl oz, 8 Pack, 3 Sets', 'POWERADE Orange Bottles, 28 fl oz, 15 Pack', 'Powerade Sports Drink – Mountain Berry Blast Bottles, 28 fl oz, 15 Pack', 'Pure Leaf – Raspberry Iced Tea – 12/18.5 oz bottles', 'Pure Leaf – Sweet Iced Tea – 12/18.5 oz bottles', 'Pure Leaf – Unsweetened Iced Tea – 15/18.5 oz bottles', 'Rainbo Rich 4/1 gallon – Pink Lemonade Sno Cone Syrup', 'Rainbow Rich – Blue Raspberry Syrup – gallon', 'Rainbow Rich – Fruit Punch Syrup – 1 Gal', 'Rainbow Rich – Lemonade Syrup, 5+1 – gallon', 'Real – Blueberry Puree Infused Syrup – 16.9 oz', 'Real – Mango Puree Infused Syrup, 6 Pack, 16.9 oz', 'Real – Peach Puree Infused Syrup, 16.9 oz, 6 Pack', 'Real – Strawberry Puree Infused Syrup, 6 Pack, 16.9 oz', 'Realemon – 100% Lemon Juice -gallon', 'ReaLemon Juice – 12/32 oz', 'ReaLemon Juice – 12/8 oz', 'ReaLemon Juice – 24/2.5 oz plastic bottle', 'ReaLime Juice 8 oz plastic bottle – 12 ct', 'Red Bull – Coconut Berry Energy Drink – 24/8.4 oz', 'Red Bull – Energy Drink, Sugar Free – 12/16 oz', 'Red Bull – Energy Drink, Sugar Free – 12/20 oz', 'Red Bull – Energy Drink, Sugar Free – 24/8.4 oz', 'Red Bull – The Blue Edition Energy Drink – 24/8.4 oz', 'Red Bull – Tropical Yellow Edition Energy Drink – 24/8.4 oz', 'Red Bull Energy Drink – 12/16 oz', 'Red Bull Energy Drink – 12/20 oz', 'Red Bull Energy Drink – 24/12 oz', 'Red Bull Energy Drink – 24/8.4 oz', 'RedBull – Peach – 8.4 Oz', 'RedBull – Total 0 – 8.4 Oz', 'RedBull – Watermelon – 8.4 OZ', 'Roland – Dirty Martini Olive Juice – 25 oz', 'Roland – Dirty Martini Olive Juice – 25 oz', 'Rose’s – Pomegranate – 1 Ltr', 'Rose’s – Simple Syrup – 1 LTR', 'Rose’s – Triple Sec – 1 Ltr', 'Roses – Lime Juice – 1ltr Bottle', 'Royal Crown – RC Cola – 24/12 oz cans', 'Sacramento – Tomato Juice – 46 oz', 'Sacramento – Tomato Juice – 46 oz cans', 'Sacramento – Tomato Juice – 48/5.5 oz cans', 'Sangria Senorial – Non-Alcoholic Sangria Flavored Sparkling Drink – 8/1.5L', 'SanPellegrino – Italian Sparkling Blood Orange – 24/330 ml', 'SanPellegrino – Italian Sparkling Blood Orange – 24/330 ml', 'Sanpellegrino – Limonata, Sparkling Lemon Drink – 24/11.1 oz', 'Sanpellegrino – Sparkling Blood Orange Drink – 24/11 oz', 'Sanpellegrino – Sparkling Fruit Drink Variety Pack – 24/11.1 oz', 'Sanpellegrino – Sparkling Grapefruit Drink – 24/11.1 oz', 'Sanpellegrino – Sparkling Natural Mineral Water – 24/16.9 oz', 'Sanpellegrino – Sparkling Natural Mineral Water – 24/250 ml', 'Sanpellegrino – Sparkling Natural Mineral Water – 750 ml', 'Sanpellegrino – Sparkling Orange – 24/300 ml', 'Sanpellegrino – Sparkling Water – 24/500 ml glass bottles', 'Seagram’s Ginger Ale – 2.5 gallon bag-in-box syrup', 'Shishito Peppers', 'Sidral Mundet- Apple Soda – 24/12 oz glass bottles', 'Sidral Mundet- Apple Soda – 24/16.9 oz plastic bottles', 'Smartwater – 24/20 fl oz plastic bottles', 'SmartWater – Sport – 700 Ml', 'Smartwater 33.8 fl oz, 6 Pack', 'Snapple – Apple – 16 Oz', 'Snapple – Diet Peach – 16 Oz', 'Snapple – Diet Tea Variety Pack – 20 oz', 'Snapple – Fruit Punch Juice – 24/16 oz glass bottles', 'Snapple – Iced Tea Variety Pack – 24/20 oz', 'Snapple – Kiwi Strawberry – 16 oz', 'Snapple – Lemon Tea – 12/16 oz', 'Snapple – Mango Madness – 12/16 Oz', 'Snapple – Mango Tea – 12/16 oz bottles', 'Snapple – Peach Tea – 12/16 oz bottles', 'Snapple – Raspberry Tea – 16 Oz', 'Snapple – Variety Pack Juice -24/20 oz', 'Sno Ball – Banana Syrup, 5+1 – gallon', 'Sno Ball – Blue Raspberry Syrup, 5+1 – gallon', 'Sno Ball – Cherry Syrup, 5+1 – gallon', 'Sno Ball – Coconut Syrup, 5+1 – gallon', 'Sno Ball – Fruit Punch Syrup, 5+1 – gallon', 'Sno Ball – Grape Syrup, 5+1 – gallon', 'Sno Ball – Lemon Syrup, 5+1 – gallon', 'Sno Ball – Orange Syrup, 5+1 – gallon', 'Sno Ball – Pineapple Syrup, 5+1 – gallon', 'Sno Ball – Root Beer Syrup, 5+1 – gallon', 'Sno Ball – Strawberry Syrup, 5+1 – gallon', 'Sno Ball – Tamarindo Syrup, 5+1 – gallon', 'Sno Ball – Vanilla Syrup, 5+1 – gallon', 'Sno Ball – Watermelon Syrup, 5+1 – gallon', 'Sprite – 2.5 gallon bag-in-box syrup', 'Sprite – 24/20 oz plastic bottles', 'Sprite – 5 gallon bag-in-box syrup', 'Sprite Bottles, 2 Liters, 4 Pack, 2 Sets', 'Sprite Cans, 12 fl oz, 35 Pack', 'Sprite Cans, 7.5 fl oz, 10 Pack, 3 Sets', 'Sprite Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Sprite Mexico Glass Bottles, 355 mL, 24 Pack', 'Squirt – Citrus Soda – 8/2 Ltr', 'Squirt- Citrus Soda – 24/12 oz cans', 'Starbucks – Double Shot Coffee – 15 Oz', 'Starbucks – Doubleshot Mocha – 12/15 oz', 'Starbucks – Mocha Frappuccino – 15/9.5oz', 'Starbucks – Vanilla Frappuccino – 15/9.5oz', 'Starbucks Doubleshot Vanilla – 12/15 oz cans', 'Stash – Chai Spice Tea – 30 ct', 'Stash – Chamomile Tea – 30 ct', 'Stash – Decaf Earl Grey Tea – 30 ct', 'Stash – Decaf Green Tea – 30 ct', 'Stash – Earl Grey Tea – 30 ct', 'Stash – English Breakfast Tea – 30 ct', 'Stash – Jasmine Blossom Green Tea – 30 ct', 'Stash – Lemon Ginger Tea – 30 ct', 'Stash – Moroccan Mint Green Tea – 30 ct', 'Stash – Orange Spice Black Tea – 30 Ct', 'Stash – Organic Green Tea – 30 ct', 'Stash – Peppermint Tea – 30 ct', 'Stash – Pomegranate Raspberry Green Tea – 30 Ct', 'Stash – Premium Green Tea – 30 ct', 'Stash – Wild Raspberry Hibiscus Tea – 30 ct', 'Supremo Italiano – Decaf Espresso Pods – 100/7.25 grams', 'Supremo Italiano – Espresso Pods – 100/7.25 grams', 'Supremo Italiano – Whole Bean Espresso Coffee – 2 lbs', 'Swiss Miss – Hot Cocoa Mix – 60 Ct', 'Tabasco – Bloody Mary Mix – 32 oz Bottle', 'The Mountain Valley Sparkling Water – 1 Ltr', 'The Mountain Valley Spring Water – 12/1 Ltr', 'Topo Chico – Sparkling Mineral Water – 24/20 oz bottles', 'Topo-Chico – Agua Mineral – 24/11.5 oz', 'Torani – Amaretto Syrup – 750 ml', 'Torani – Caramel Syrup – 750 ml', 'Torani – Cheesecake Syrup – 750 ml', 'Torani – Cherry Syrup – 750 ml', 'Torani – Chocolate Milano Syrup – 750 ml', 'Torani – Cinnamon Syrup – 750 ml', 'Torani – Coconut Syrup – 750 ml', 'Torani – Creme di Menthe Syrup – 750 ml', 'Torani – English Toffee Syrup – 750 ml', 'Torani – French Vanilla Syrup – 750 ml', 'Torani – French Vanilla Syrup Sugar Free – 750 ml', 'Torani – Hazelnut Syrup – 750 ml', 'Torani – Irish Cream Syrup – 750 ml', 'Torani – Mango Smoothie Mix – 64 oz', 'Torani – Mango Syrup – 750 ml', 'Torani – Peach Smoothie Mix – 64 oz', 'Torani – Peach Syrup – 750 ml Bottle', 'Torani – Peppermint Syrup – 750 ml', 'Torani – Pineapple Syrup – 750 ml', 'Torani – Pomegranate Syrup – 750 ml', 'Torani – Pumpkin Pie Syrup – 750 ml', 'Torani – Pumpkin Spice Syrup – 750 ml', 'Torani – Raspberry Smoothie Mix – 64 oz', 'Torani – Raspberry Syrup – 750 ml', 'Torani – Strawberry Banana Smoothie Mix – 64 oz', 'Torani – Strawberry Smoothie Mix – 64 oz', 'Torani – Strawberry Syrup – 750 ml', 'Torani – Sugar-Free Hazelnut Syrup – 750 ml', 'Torani – Sugar-Free Vanilla Syrup – 750 ml', 'Torani – Tiramisu Syrup – 750 ml', 'Torani – Vanilla Syrup – 750 ml', 'Torani – White Chocolate Sauce – 64 oz', 'Torani – White Chocolate Syrup – 750 ml', 'Torani – Wild Berry Smoothie Mix – 64 oz', 'Tropicana – 100% Orange Juice, Shelf Stable – 12/15 oz', 'Tropicana – Apple Juice – 12/32 oz', 'Twinings – English Breakfast Tea, K-Cup – 24 Ct', 'Twinings – Green, Pomegranate, Raspberry, & Strawberry Tea – 25 Ct', 'Twinings – Lemon Ginger Tea – 25 Ct', 'Twinings – Organic Cinnamon Spice Tea – 25 Ct', 'Twinings Tea – Chai Flavor – 25 ct', 'Twinings Tea – Earl Grey- 25Ct', 'Twinings Tea – English Breakfast – 25 Ct', 'Twinings Tea – English Breakfast, Decaffeinated – 25 Ct', 'Twinings Tea – Green Tea – 25Ct', 'Twinings Tea – Green Tea with Jasmine – 25 Ct', 'Twinings Tea – Pure Camomile Herbal Tea – 25Ct', 'Twinings Tea – Pure Peppermint Herbal Tea – 25 Ct', 'V8 – Vegetable Juice – 12/46 oz cans', 'V8 – Vegetable Juice Original – 28/11.5 oz cans', 'V8- Vegetable Juice – 12/12 oz plastic bottles', 'Victor Allen – Single Serve Coffee, Caramel Macchiato – 42 ct', 'Victor Allen – Single Serve Coffee, Italian Roast – 42 ct', 'Victor Allen – Single Serve Kona Coffee Blend – 42 ct', 'Victor Allen’s – Single Serve Colombian Roast Coffee – 42ct', 'Victor Allen’s – Single Serve Donut Shop Coffee – 42ct', 'Victor Allen’s – Single Serve French Roast Coffee – 42ct', 'Victor Allen’s – Single Serve Hazelnut Coffee – 42 ct', 'Victor Allen’s – Single Serve Morning Blend Coffee – 42ct', 'Victor Allen’s – Single Serve Organic Peruvian Coffee – 42 ct', 'Victor Allen’s – Single Serve Organic Peruvian Coffee – 42 ct', 'VitaminWater – Energy, Tropical Citrus Bottles, 20 fl oz, 12 Pack', 'VitaminWater – Essential, Orange-Orange Bottles, 20 fl oz, 12 Pack', 'VitaminWater – Focus, Kiwi Strawberry – 20 fl oz', 'VitaminWater – Power-C, Dragonfruit – 20 fl oz, 12 Pack', 'VitaminWater – Revive, Fruit Punch Bottles 20 fl oz', 'VitaminWater – XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack', 'VitaminWater Zero – XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack', 'Voss Water – 500 Ml', 'Voss Water – 500 Ml', 'Zing Zang – Bloody Mary Mix, 12 Pack, 32 oz']
   for name in product_names:
      qty_and_type = name.text.split('–')[-1]
      if qty_and_type != name:
         print(qty_and_type)
      elif name != name.text.split(',')[-1]:
         print(name.text.split(',')[-1])
      else:
         print(name.text.split('-')[-1])
      

The code is not working as i expected is there any effective way to do this kind of stuff.I mean when i use split('–') if the string doesn't have delimiter it will just ignore it is there anything way to get some exception when the specified delimiter is not present in the string.

Upvotes: 1

Views: 227

Answers (1)

Stef
Stef

Reputation: 15505

Sadly I don't think there is a foolproof way to recognise which separator was used, given that -, , and all appear both as separator or as part of the product type.

Worse than that, you also have:

  • two examples where there is no separator at all except a space:
  • one example where there is no quantity.

Here is an attempt, which works on your small example, but fails on your larger example:

products_small = ["7-Up Soda – 24/12 oz cans",
    "A&W Root Beer, 12 oz cans, 12 pack",
    "Aldi Milk-15 gallon",
    "Arizona – Arnold Palmer, Iced Tea & Lemonade – 24/23 oz cans",
    "Balle Balle- Kesar Mango Pulp – case",
]
products_large = ['7-Up Soda – 24/12 oz cans', '7-Up Soda – 8/2L plastic bottles', 'A&W Root Beer – 24/12 oz cans', 'A&W Root Beer, 12 oz cans, 12 pack', 'Abuelita – Hot Cocoa Mix – 6/2 lbs Bag', 'Acqua Panna Spring Water – 24/.5 L plastic bottles', 'Acqua Panna Water – 12/1L glass bottles', 'Aldi Milk-15 gallon', 'Arizona – Arnold Palmer, Iced Tea & Lemonade – 24/23 oz cans', 'Arizona – Fruit Punch – 24/23 oz cans', 'Arizona – Grapeade – 24/23 oz cans', 'Arizona – Green Tea – 24/23 oz', 'Arizona – Kiwi-Strawberry – 24/23 oz cans', 'Arizona – Lemonade – 24/23.5 oz cans', 'Arizona – Mucho Mango – 24/23 oz cans', 'Arizona – Rx Energy, Herbal Tonic- 24/23 oz cans', 'Arizona – Southern Style – Sweet Tea – 24/23 oz cans', 'Arizona – Watermelon Juice Drink – 24/23 oz cans', 'Arizona Half Iced Tea & Half Mango – 24/23.5 oz cans', 'Bai – Brasilia Blueberry – 12/18 oz bottles', 'Bai – Molokai Coconut – 18 oz', 'Balle Balle- Kesar Mango Pulp – case', 'Bang – Candy Apple Crisp, 16 oz, 12 Pk', 'Bang – Cotton Candy Energy Drink – 12/16 oz', 'Bang – Lemon Drop Energy Drink – 12/16 oz', 'Bang – Peach Honey Energy Drink – 12/16 oz', 'Bang – Pear Guava Energy Drink – 12/16 oz', 'Bang – Rainbow Unicorn Energy Drink – 12/16 oz', 'Bang – Sour Heads Energy Drink – 12/16 oz', 'Bang – Star Blast Energy Drink – 12/16 oz', 'BANG BLUE RAZZ 16Z', 'BANG BLUE RAZZ 16Z', 'Barq’s Root Beer – 2.5 gallon bag-in-box syrup', 'Big Geyser – Core Water – 1 Liter', 'Big Train – Mocha Blended Ice Coffee Mix – 3.5 lb', 'Bonnie – Chocolate Syrup – gallon', 'Bonnie – Fruit Punch Syrup, 7+1 – gallon', 'Bonnie – Grape Syrup, 7+1 – gallon', 'Bonnie – Lemonade Syrup, 7+1 – gallon', 'Bonnie – Orange Syrup, 7+1 – gallon', 'Bundaberg – Peach – 12.7 oz', 'Callebaut – High Fat Cocoa Powder, 22-24% – 4lb Bags', 'Calypso – Black Cherry Lemonade – 12/16 Oz', 'Calypso – Blue Lemonade – 16 Oz', 'Calypso – Original Lemonade – 12/16 Oz', 'Calypso – Peach Tea & Lemonade – 12/16 Oz', 'Calypso – Strawberry Lemonade – 16 Oz', 'Calypso – Triple Melon Lemonade – 12/16 Oz', 'Canada Dry – Ginger Ale – 24/12 oz cans', 'Canada Dry Club Soda – 24/12 oz cans', 'Canada Dry Tonic Water – 24/12 oz cans', 'Carnation Malted Milk – 2.5 lbs', 'Chakoah – Coconut Milk – 24/13 oz cans', 'Chef’s Quality – 100% Columbian Coffee – 1 lb pkgs', 'Chef’s Quality – Cocoa Powder – 5 Lb', 'Chef’s Quality – Colombian Ground Coffee – 42/2 oz Packets', 'Chef’s Quality – Columbian Decaffeinated Coffee – 42/2 oz Packet', 'Chef’s Quality – Donut Shop Blend – 2lb. Bag', 'Chef’s Quality – Lemon Juice – 32 oz Bottle', 'Chef’s Quality – Lemon Juice – gallon', 'Chef’s Quality – Lime Juice – 32 oz Bottle', 'Chef’s Quality – Lime Juice – gallon', 'Chef’s Quality – Roaster Reserve Blend Coffee – 36 ct', 'Chef’s Quality – Whole Bean Colombian Coffee – 2.5 lb Bag', 'Chef’s Quality Hotel & Restaurant Blend Coffee – 34.5 oz', 'Cherry Coke – 2.5 gallon bag-in-box syrup', 'Coca-Cola – 2.5 gallon bag-in-box syrup', 'Coca-Cola – 5 gallon bag-in-box syrup', 'Coca-Cola Bottles, 16.9 fl oz, 24 Pack', 'Coca-Cola Bottles, 2 Liters, 4 Pack, 2 Sets', 'Coca-Cola Cans, 12 fl oz, 35 Pack', 'Coca-Cola Cans, 16 fl oz, 24 Pack', 'Coca-Cola Cans, 7.5 fl oz, 4 Pack', 'Coca-Cola Energy Cans, 12 fl oz, 24 Pack', 'Coca-Cola Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Coca-Cola Mexico Glass Bottles, 355 mL, 6 Pack, 4 Sets', 'Coca-Cola Zero Sugar Cans, 12 fl oz, 35 Pack', 'Coco Lopez – Cream of Coconut – 15 oz', 'Coco Lopez – Cream of Coconut – 15 oz', 'Coco Lopez – Cream of Coconut – 57 oz Can', 'Coffee mate – French Vanilla Creamer Pump – 1.5 Ltr', 'Coffee mate – Hazelnut Creamer Pump- 1.5 Ltr', 'Coffee mate – Original Creamer Pump – 1.5 Ltr', 'Coffee mate – Original Liquid Creamer Cups – 180 Ct', 'Coffee mate Creamer, Snickers Flavor – 50 ct', 'Coke Classic, 20 oz bottles – 24 ct', 'Coke Zero – 2.5 gallon bag-in-box syrup', 'Country Time Lemonade – packet makes 2 gallons', 'Crush – Strawberry Soda – 24/12 oz cans', 'Crush Grape Soda – 24/12 oz cans', 'Daily’s – Lime Juice – 1 ltr Bottle', 'Daily’s – Margarita Mix – 1 ltr Bottle', 'Daily’s – Margarita Mix – 64 oz Bottle', 'Daily’s – Peach Daiquiri Mix – 64 oz bottle', 'Daily’s – Pina Colada Mix – 64 oz bottle', 'Daily’s – Raspberry Daiquiri – 64 oz bottle', 'Daily’s – Simple Syrup – 1 ltr Bottle', 'Daily’s – Sour Mix – gallon Bottle', 'Daily’s – Strawberry Daiquiri Mix – 1lr Bottle', 'Daily’s – Strawberry Daiquiri Mix – 64 oz Bottle', 'Daily’s – Sweet & Sour Mix – 1 ltr Bottle', 'Daily’s – Sweet & Sour Mix – 64 oz bottle', 'Daily’s – Triple Sec Syrup – 32 oz bottle', 'DASANI Purified Water Bottles, 20 fl oz, 24 Pack', 'Delicia – Jamaica Drink Concentrate – 32 oz', 'Delicia – Tamarind Drink Concentrate – 32 oz lb', 'Diet 7-Up, 12 oz cans, 24 pack', 'Diet Coke – 2.5 gallon bag-in-box syrup', 'Diet Coke – 5 gallon bag-in-box syrup', 'Diet Coke Bottle, 20 fl oz – 24 ct', 'Diet Coke Bottles, 16.9 fl oz, 24 Pack', 'Diet Coke Bottles, 2 Liters, 4 Pack, 2 Sets', 'Diet Coke Cans, 12 fl oz, 35 Pack', 'Diet Coke Cans, 7.5 fl oz, 10 Pack, 3 Sets', 'Diet Coke Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Diet Pepsi – 2 Ltr', 'Diet Pepsi – 35/12 oz', 'Diet Pepsi Cube – 36/12 oz cans', 'Dole – Pineapple Juice – 24/8.4 oz cans', 'Dole – Pineapple Juice – 46 oz cans', 'Dole – Pineapple Juice – 48/6 oz cans', 'DominAde – Fruit Punch Mix – 12/21.6 oz', 'DominAde Drink Mix- Lemon- 12/21.6 oz pouch', 'DominAde Drink Mix- Pink Lemonade – 12/21.6 oz pouch', 'Dr.Pepper – 24/12 oz cans', 'Dr.Pepper – 24/20 oz plastic bottles', 'Dr.Pepper – 8/2L plastic bottles', 'Essentia Water – 12/1 Ltr', 'Essentia Water – 24/20 oz', 'Evon’s – Malt Liquid – 4/1 gallon', 'Evon’s – Neutral Slush Syrup – gallon', 'Evon’s – Sour Lemon Bar Mix – gallon', 'Evon’s – Sweet & Sour Mix – gallon', 'Fanta – Orange Soda – 24/20 oz', 'Fanta Orange – 2.5 gal bag in box syrup', 'Fanta Orange Mexico Glass Bottles, 355 mL, 4 Pack, 6 Sets', 'Fanta Orange Soda Bottles, 2 Liters, 8 Pack', 'Fanta Orange Soda Cans, 12 fl oz, 24 Pack', 'Fiji – Water – 700 ml', 'Fiji Water – 11.2 oz plastic bottles', 'Fiji Water – 12/1L plastic bottles', 'Fiji Water – 24/0.5L bottles', 'Finest Call – Bloody Mary Mix – 1 ltr Bottle', 'Finest Call – Grenadine – 1 ltr Bottle', 'Finest Call – Lime Sour Mix – 1 Liter', 'Finest Call – Mango Puree Mix – 1 ltr Bottle', 'Finest Call – Margarita Mix – 1 ltr Bottle', 'Finest Call – Passion Fruit Puree Mix – 1 ltr Bottle', 'Finest Call – Peach Puree Mix – 1 ltr Bottle', 'Finest Call – Pina Colada Mix – 1 ltr Bottle', 'Finest Call – Pomegranate Mix – 1 ltr Bottle', 'Finest Call – Raspberry Puree Mix – 1 ltr Bottle', 'Finest Call – Strawberry Puree Mix – 1 ltr Bottle', 'Finest Call – Sweet & Sour Mix – 1 ltr Bottle', 'Finest Call – Triple Sec Syrup – 1 ltr Bottle', 'Finest Call – Watermelon Puree Mix – 1 ltr Bottle', 'Foco – Coconut Juice – 24/11.8 oz cans', 'Foco – Coconut Juice – 24/17.6 oz cans', 'Folger’s – Classic Roast Ground Coffee – 48 oz', 'Folger’s – Classic Roast Ground Coffee Packets – 42/1.2 oz packets', 'Folger’s – Classic Roast Ground Coffee Packets – 42/1.2 oz packets', 'Folger’s Coffee – Classic Decaffeinated – 30.5 oz', 'Fuze – Sweet Tea – 2.5 Gal', 'Gatorade – All Star Core Variety Pack – 28/12 oz plastic bottles', 'Gatorade – All Star Original Variety Pack – 28/12 oz plastic bottles', 'Gatorade – All Star Original Variety Pack – 28/12 oz plastic bottles', 'Gatorade – Cool Blue – 24/20 oz plastic bottles', 'Gatorade – Fruit Punch- 24/20 oz plastic bottles', 'Gatorade – Lemon Lime Flavor – 24/20 oz bottles', 'Gatorade – Orange – 24/20 oz plastic bottles', 'Gatorade – Thirst Quencher, Sports Drinks Core Variety Pack, 12 oz, 28 Ct', 'Gatorade Zero Variety Pack – 28/12 oz', 'Ghirardelli – Caramel Sauce – 64 oz Bottle', 'Ghirardelli – Chocolate Cocoa Sauce – 64 oz', 'Ghirardelli – Hot Fudge Sauce – #10 can', 'Ghirardelli – Hot Fudge Squeeze Bottle – 23 oz', 'Gold Peak Sweetened Black Tea Bottle, 18.5 fl oz', 'Gold Peak Unsweetened Black Tea Bottle, 18.5 fl oz', 'Golden – Pomegranate Molasses – 10 oz', 'Gosling’s – Ginger Beer – 24/12 oz', 'Goya – Mango Nectar – 24/9.6 oz cans', 'Hawaiian Punch- 24/12 oz cans', 'Hershey’s Bulk Dutch Cocoa Powder, 10-13% – 25 lbs', 'Hiko – Carrot Apple/Peach – 750 Ml', 'Hiko – Carrot Nectar – 750 Ml', 'Honest Tea Half Tea & Half Lemonade Bottles, 16.9 fl oz, 12 Pack', 'Honest Tea Honey Green Bottles, 16.9 fl oz, 12 Pack', 'IBC – Cream Soda – 6/4 Pk', 'IBC – Root Beer with Real Sugar – 12 Oz, 24 ct', 'Ice Mountain – Natural Spring Water – 15/1L', 'Ice Mountain – Natural Spring Water – 28/20 oz', 'Ice Mountain Spring Water – 40/0.5 L oz plastic bottles', 'Ice Mountain- Distilled Water – 6/1 gal plastic bottles', 'Ice Mountain- Natural Spring Water with Flip cap – 24/23.6 oz bottles', 'Ice Mountain- Spring Water – 48/8 oz plastic bottles', 'Ice Mountain- Spring Water – 6/1 gal plastic bottles', 'Jarritos – Fruit Punch Soda – 24/12.5 oz glass bottles', 'Jarritos – Fruit Punch Soda – 24/16.9 oz plastic bottles', 'Jarritos – Glass Variety Pack – 24/12 oz', 'Jarritos – Grapefruit Soda – 24/12.5 oz glass bottles', 'Jarritos – Lime Soda – 24/12.5 oz glass bottles', 'Jarritos – Lime Soda – 24/500ml', 'Jarritos – Mandarin Soda – 24/12.5 oz glass bottles', 'Jarritos – Mandarin Soda – 24/500ml', 'Jarritos – Mandarin Soda – 8/1.5L plastic bottles', 'Jarritos – Mango Soda – 24/12.5 oz glass bottles', 'Jarritos – Mineragua (Club Soda)- 24/12.5 oz glass bottles', 'Jarritos – Mineragua (Club Soda)- 24/500ml bottles', 'Jarritos – Mineragua (Club Soda)- 8/1.5.L plastic bottles', 'Jarritos – Pineapple Soda – 24/12.5 oz glass bottles', 'Jarritos – Pineapple Soda – 24/500ml', 'Jarritos – Strawberry Soda – 24/12.5 oz glass bottles', 'Jarritos – Tamarind Soda – 24/12.5 oz glass bottles', 'Jarritos – Tamarind Soda – 8/1.5L plastic bottles', 'Jarritos – Tamarindo Soda – 24/500ml', 'Jarritos – Variety Pack, 500 ml – 24 ct', 'Jero – Sweet & Sour Mix Syrup – 4/1 gallon', 'Jumex – Nectar Variety Pack – 24/11.3 oz', 'Karo – Dark Corn Syrup (Blue Label) – gallon', 'LaCroix – Grapefruit Sparkling Water -2/12 pack', 'LaCroix – Lemon Sparkling Water – 24/12 oz', 'LaCroix – Lime Sparkling Water – 24/12 oz', 'LaCroix – Mango Sparkling Water – 24/12 oz cans', 'LaCroix – Passion Fruit Sparkling Water – 2/12 Pack', 'LaCroix – Peach Pear Sparkling Water – 24/12 oz', 'LaCroix – Plain Sparkling Water – 24/12 oz', 'LaCroix – Tangerine Sparkling Water – 24/12 oz', 'Lavazza – Decaf Espresso – 1.1 Lb', 'Lavazza – Espresso in Blu Coffee Tins – 8.8 oz', 'Lavazza – Gran Espresso – 2.2 Lb', 'Lavazza – Italian Roast Drip Coffee Grounds – 30/2.25 oz', 'Lavazza – Quality Rossa – 2.2 lb', 'Lavazza – Super Crema Espresso Coffee Beans – 2.2 lbs', 'Lipton – Auto Brew Regular Flavored Tea Bags – 24/3 oz', 'Lipton – Green Tea – 100 Ct', 'Lipton – Iced Tea Bags – 24 ct', 'Lipton – Original Flavored Regular Tea Bags – 100 ct', 'Lipton Brisk – 36/12 oz cans', 'Little Hug – Variety Pack – 40/8 oz', 'Malta India – Non Alcoholic Malt Beverage – 24/7 oz', 'Manzanita Sol – Apple Soda – 24/12 oz can', 'Manzo – Mango Nectar – 1L', 'Master of Mixes – Margarita Salt – 8 oz pkgs', 'Maxwell House – Original Ground Decaf Coffee – 29 oz', 'Maxwell House Original Ground Coffee – 30.6 oz', 'Mexican 7-Up In Glass Bottle – 12 Ct', 'Mexican Squirt- Citrus Soda – 12/12 oz glass bottles', 'Minute Maid – Lemonade – 2.5 gallon bag-in-box syrup', 'Minute Maid Orchard’s Best Cranberry Juice Cocktail – 2.5 gallon bag-in-box', 'Mistic – Bahama Blueberry Drink – 24/16 oz glass bottles', 'Mistic – Lotta Colada Drink – 24/16 oz glass bottles', 'Mistic – Orange Carrot Drink – 12/16 oz glass bottles', 'Mistic – Strawberry Grape Drink – 24/16 oz glass bottles', 'Mistic – Strawberry Kiwi Drink – 24/16 oz glass bottles', 'Mistic -Tropical Fruit Punch- 24/16 oz glass bottles', 'Monster – Java Coffee Mean Bean & Loca Moca – 15 OZ', 'Monster – Ultra Paradise Energy Drink – 24/16 oz', 'Monster Assault – 16 Oz', 'Monster Energy Drink – 24/16 oz cans', 'Monster Energy Drink – Absolutely Zero – 24/16 oz cans', 'Monster Energy Drink – Low-Carb- 24/16 oz cans', 'Monster Energy Drink – Mega – 12/24 oz cans', 'Monster Energy Drink – Ultra Sunrise – 24/16 oz cans', 'Monster Energy Drink – Zero Ultra – 24/16 oz cans', 'Monster Energy Drink -Java Monster (Loco Moca)- 12/15 oz cans', 'Monster Energy Drink -Java Monster (Mean Bean)- 12/15 oz cans', 'Monster Energy Ultra Variety Pack – 24/16 oz', 'Mott’s – Apple Juice – 8/64 oz plastic bottles', 'Mott’s – Apple Juice -24/8 oz plastic bottles', 'Mott’s – Apple Juice Minis – 4 Pk', 'Mott’s – Clamato Juice – 1L plastic bottle', 'Mott’s – Clamato Juice – 24/5.5 oz cans', 'Mott’s – Fruit Punch Mini Juice Box – 4 Pk', 'Mott’s Apple Juice – 24/10 oz glass bottles', 'Mott’s Apple Juice – gallon', 'Mott’s Apple Juice – gallon', 'Mott’s Clamato Juice – 12/32 oz plastic bottles', 'Mott’s Clamato Tomato Cocktail – 2/64 oz plastic bottles', 'Mott’s Spicy Clamato Juice (Picante) – 12/32 oz plastic bottle', 'Mountain Dew – 24/20 oz bottles', 'Mountain Dew – 8/2L bottles', 'Mountain Dew Cube – 36/12 oz cans', 'Mr Pure – Orange Juice – 10 Oz', 'Mr. & Mrs. T – Bloody Mary Mix – 1 ltr Bottle', 'Mr.Pure – Cranberry Juice – 6/64 oz plastic bottles', 'Mr.Pure – Orange Juice – 6/64 oz plastic bottles', 'Naked – Green Machine Juice – 15.2 Oz', 'Naked – Mighty Mango – 15.2 Oz', 'Naked Juice – Blue Machine – 8/15.2 oz', 'Naked Juice – Red Machine – 15.2 Oz', 'Nantucket Nectars – Orange – 24/16 oz glass bottles', 'Nesquik – Chilled Strawberry Beverage – 12/14 oz', 'Nesquik – Chocolate Ready to Drink Beverage – 12/14 oz', 'Nesquik – Vanilla Drink – 12/14 oz', 'Nesquik – Vanilla Drink – 12/14 oz', 'Nestle Pure Life – Purified Water – 35/0.5L plastic bottles', 'Nestle Pure Life – Purified Water – 48/8 oz plastic bottles', 'Nestle Pure Life Water – 24/24 oz plastic bottles', 'Nestle Water – Acqua Panna – 12/750 Ml', 'Nestle Water – NPL Purified – 20 Oz', 'Nestle Whipper Mix – 2 lbs', 'Ocean Spray – 100% Orange Juice – 48/5.5 oz cans', 'Ocean Spray – 100% Orange Juice, Bar Pack – 32 oz Bottle', 'Ocean Spray – 100% White Grape Juice – 48/5.5 oz cans', 'Ocean Spray – Cranberry Juice Cocktail – 48/5.5 oz', 'Ocean Spray – Cranberry Juice Cocktail – 60 oz', 'Ocean Spray – Cranberry Juice Cocktail Bar Pack – 12/32 oz Bottle', 'Ocean Spray – Ruby Red Grapefruit Juice – 60 oz', 'Ocean Spray – White Grapefruit Juice – 12/32 oz Bottle', 'Ocean Spray- Apple Juice – 48/5.5 oz cans', 'Ocean Spray- Cranberry Juice Cocktail – 8/64 oz plastic bottles', 'OKF – Aloe Vera, Fruit Punch – 12/16.9 Oz', 'OKF – Organic Aloe Drink – 12/16.9 oz', 'OKF – Red Smoothie – 16.9 OZ', 'OKF – Yellow Smoothie – 16.9 Oz', 'Orange Crush Cube – 24/12 oz cans', 'Orange Crush Soda – 24/20 oz bottles', 'Oregon Chai Tea Concentrate – 32 oz', 'Parks – Pomegranate Juice – 1 Liter', 'Pepsi – Cola Cube Pack – 36/12 oz cans', 'Pepsi – Diet 20 oz', 'Pepsi Cola – 24/20 oz bottles', 'Pepsi Cola – 8/2L plastic bottles', 'Pepsi Cola (Mexican) – 24/12 oz glass bottles', 'Perrier – Sparkling Mineral Water – 24/11 oz glass bottles', 'Perrier – Sparkling Mineral Water – 24/16.9 oz plastic bottles', 'Pibb Xtra Soda – Syrup 2.5 gal bag-in-box', 'Pocas – Mango Nectar – 8.5 Oz', 'Pocas – OKF Farmers Aloe Original – 50.4 Oz', 'Pocas International – OKF Farms Aloe Watermelon – 16.9 Oz', 'Pocas OKF – Aloe Mango – 16.9 Oz', 'Pocas OKF – Farm Aloe CoCo – 16.9 Oz', 'Pocas OKF – Farm Aloe Pomegranate – 16.9 Oz', 'Pocas OKF – Farm Aloe Strawberry – 16.9 Oz', 'Pocas OKF – Farmers Aloe Pineapple – 16.9', 'Pocasville – Guava Nectar – 8.5 Oz', 'Pocos – Oak Farm Original Aloe Drink – 12/16.9 oz', 'POWERADE Fruit Punch Bottles, 28 fl oz, 15 Pack', 'POWERADE Lemon Lime Bottles, 28 fl oz, 15 Pack', 'POWERADE Mountain Berry Blast Bottles, 20 fl oz, 8 Pack, 3 Sets', 'POWERADE Orange Bottles, 28 fl oz, 15 Pack', 'Powerade Sports Drink – Mountain Berry Blast Bottles, 28 fl oz, 15 Pack', 'Pure Leaf – Raspberry Iced Tea – 12/18.5 oz bottles', 'Pure Leaf – Sweet Iced Tea – 12/18.5 oz bottles', 'Pure Leaf – Unsweetened Iced Tea – 15/18.5 oz bottles', 'Rainbo Rich 4/1 gallon – Pink Lemonade Sno Cone Syrup', 'Rainbow Rich – Blue Raspberry Syrup – gallon', 'Rainbow Rich – Fruit Punch Syrup – 1 Gal', 'Rainbow Rich – Lemonade Syrup, 5+1 – gallon', 'Real – Blueberry Puree Infused Syrup – 16.9 oz', 'Real – Mango Puree Infused Syrup, 6 Pack, 16.9 oz', 'Real – Peach Puree Infused Syrup, 16.9 oz, 6 Pack', 'Real – Strawberry Puree Infused Syrup, 6 Pack, 16.9 oz', 'Realemon – 100% Lemon Juice -gallon', 'ReaLemon Juice – 12/32 oz', 'ReaLemon Juice – 12/8 oz', 'ReaLemon Juice – 24/2.5 oz plastic bottle', 'ReaLime Juice 8 oz plastic bottle – 12 ct', 'Red Bull – Coconut Berry Energy Drink – 24/8.4 oz', 'Red Bull – Energy Drink, Sugar Free – 12/16 oz', 'Red Bull – Energy Drink, Sugar Free – 12/20 oz', 'Red Bull – Energy Drink, Sugar Free – 24/8.4 oz', 'Red Bull – The Blue Edition Energy Drink – 24/8.4 oz', 'Red Bull – Tropical Yellow Edition Energy Drink – 24/8.4 oz', 'Red Bull Energy Drink – 12/16 oz', 'Red Bull Energy Drink – 12/20 oz', 'Red Bull Energy Drink – 24/12 oz', 'Red Bull Energy Drink – 24/8.4 oz', 'RedBull – Peach – 8.4 Oz', 'RedBull – Total 0 – 8.4 Oz', 'RedBull – Watermelon – 8.4 OZ', 'Roland – Dirty Martini Olive Juice – 25 oz', 'Roland – Dirty Martini Olive Juice – 25 oz', 'Rose’s – Pomegranate – 1 Ltr', 'Rose’s – Simple Syrup – 1 LTR', 'Rose’s – Triple Sec – 1 Ltr', 'Roses – Lime Juice – 1ltr Bottle', 'Royal Crown – RC Cola – 24/12 oz cans', 'Sacramento – Tomato Juice – 46 oz', 'Sacramento – Tomato Juice – 46 oz cans', 'Sacramento – Tomato Juice – 48/5.5 oz cans', 'Sangria Senorial – Non-Alcoholic Sangria Flavored Sparkling Drink – 8/1.5L', 'SanPellegrino – Italian Sparkling Blood Orange – 24/330 ml', 'SanPellegrino – Italian Sparkling Blood Orange – 24/330 ml', 'Sanpellegrino – Limonata, Sparkling Lemon Drink – 24/11.1 oz', 'Sanpellegrino – Sparkling Blood Orange Drink – 24/11 oz', 'Sanpellegrino – Sparkling Fruit Drink Variety Pack – 24/11.1 oz', 'Sanpellegrino – Sparkling Grapefruit Drink – 24/11.1 oz', 'Sanpellegrino – Sparkling Natural Mineral Water – 24/16.9 oz', 'Sanpellegrino – Sparkling Natural Mineral Water – 24/250 ml', 'Sanpellegrino – Sparkling Natural Mineral Water – 750 ml', 'Sanpellegrino – Sparkling Orange – 24/300 ml', 'Sanpellegrino – Sparkling Water – 24/500 ml glass bottles', 'Seagram’s Ginger Ale – 2.5 gallon bag-in-box syrup', 'Shishito Peppers', 'Sidral Mundet- Apple Soda – 24/12 oz glass bottles', 'Sidral Mundet- Apple Soda – 24/16.9 oz plastic bottles', 'Smartwater – 24/20 fl oz plastic bottles', 'SmartWater – Sport – 700 Ml', 'Smartwater 33.8 fl oz, 6 Pack', 'Snapple – Apple – 16 Oz', 'Snapple – Diet Peach – 16 Oz', 'Snapple – Diet Tea Variety Pack – 20 oz', 'Snapple – Fruit Punch Juice – 24/16 oz glass bottles', 'Snapple – Iced Tea Variety Pack – 24/20 oz', 'Snapple – Kiwi Strawberry – 16 oz', 'Snapple – Lemon Tea – 12/16 oz', 'Snapple – Mango Madness – 12/16 Oz', 'Snapple – Mango Tea – 12/16 oz bottles', 'Snapple – Peach Tea – 12/16 oz bottles', 'Snapple – Raspberry Tea – 16 Oz', 'Snapple – Variety Pack Juice -24/20 oz', 'Sno Ball – Banana Syrup, 5+1 – gallon', 'Sno Ball – Blue Raspberry Syrup, 5+1 – gallon', 'Sno Ball – Cherry Syrup, 5+1 – gallon', 'Sno Ball – Coconut Syrup, 5+1 – gallon', 'Sno Ball – Fruit Punch Syrup, 5+1 – gallon', 'Sno Ball – Grape Syrup, 5+1 – gallon', 'Sno Ball – Lemon Syrup, 5+1 – gallon', 'Sno Ball – Orange Syrup, 5+1 – gallon', 'Sno Ball – Pineapple Syrup, 5+1 – gallon', 'Sno Ball – Root Beer Syrup, 5+1 – gallon', 'Sno Ball – Strawberry Syrup, 5+1 – gallon', 'Sno Ball – Tamarindo Syrup, 5+1 – gallon', 'Sno Ball – Vanilla Syrup, 5+1 – gallon', 'Sno Ball – Watermelon Syrup, 5+1 – gallon', 'Sprite – 2.5 gallon bag-in-box syrup', 'Sprite – 24/20 oz plastic bottles', 'Sprite – 5 gallon bag-in-box syrup', 'Sprite Bottles, 2 Liters, 4 Pack, 2 Sets', 'Sprite Cans, 12 fl oz, 35 Pack', 'Sprite Cans, 7.5 fl oz, 10 Pack, 3 Sets', 'Sprite Glass Bottles, 8 fl oz, 6 Pack, 4 Sets', 'Sprite Mexico Glass Bottles, 355 mL, 24 Pack', 'Squirt – Citrus Soda – 8/2 Ltr', 'Squirt- Citrus Soda – 24/12 oz cans', 'Starbucks – Double Shot Coffee – 15 Oz', 'Starbucks – Doubleshot Mocha – 12/15 oz', 'Starbucks – Mocha Frappuccino – 15/9.5oz', 'Starbucks – Vanilla Frappuccino – 15/9.5oz', 'Starbucks Doubleshot Vanilla – 12/15 oz cans', 'Stash – Chai Spice Tea – 30 ct', 'Stash – Chamomile Tea – 30 ct', 'Stash – Decaf Earl Grey Tea – 30 ct', 'Stash – Decaf Green Tea – 30 ct', 'Stash – Earl Grey Tea – 30 ct', 'Stash – English Breakfast Tea – 30 ct', 'Stash – Jasmine Blossom Green Tea – 30 ct', 'Stash – Lemon Ginger Tea – 30 ct', 'Stash – Moroccan Mint Green Tea – 30 ct', 'Stash – Orange Spice Black Tea – 30 Ct', 'Stash – Organic Green Tea – 30 ct', 'Stash – Peppermint Tea – 30 ct', 'Stash – Pomegranate Raspberry Green Tea – 30 Ct', 'Stash – Premium Green Tea – 30 ct', 'Stash – Wild Raspberry Hibiscus Tea – 30 ct', 'Supremo Italiano – Decaf Espresso Pods – 100/7.25 grams', 'Supremo Italiano – Espresso Pods – 100/7.25 grams', 'Supremo Italiano – Whole Bean Espresso Coffee – 2 lbs', 'Swiss Miss – Hot Cocoa Mix – 60 Ct', 'Tabasco – Bloody Mary Mix – 32 oz Bottle', 'The Mountain Valley Sparkling Water – 1 Ltr', 'The Mountain Valley Spring Water – 12/1 Ltr', 'Topo Chico – Sparkling Mineral Water – 24/20 oz bottles', 'Topo-Chico – Agua Mineral – 24/11.5 oz', 'Torani – Amaretto Syrup – 750 ml', 'Torani – Caramel Syrup – 750 ml', 'Torani – Cheesecake Syrup – 750 ml', 'Torani – Cherry Syrup – 750 ml', 'Torani – Chocolate Milano Syrup – 750 ml', 'Torani – Cinnamon Syrup – 750 ml', 'Torani – Coconut Syrup – 750 ml', 'Torani – Creme di Menthe Syrup – 750 ml', 'Torani – English Toffee Syrup – 750 ml', 'Torani – French Vanilla Syrup – 750 ml', 'Torani – French Vanilla Syrup Sugar Free – 750 ml', 'Torani – Hazelnut Syrup – 750 ml', 'Torani – Irish Cream Syrup – 750 ml', 'Torani – Mango Smoothie Mix – 64 oz', 'Torani – Mango Syrup – 750 ml', 'Torani – Peach Smoothie Mix – 64 oz', 'Torani – Peach Syrup – 750 ml Bottle', 'Torani – Peppermint Syrup – 750 ml', 'Torani – Pineapple Syrup – 750 ml', 'Torani – Pomegranate Syrup – 750 ml', 'Torani – Pumpkin Pie Syrup – 750 ml', 'Torani – Pumpkin Spice Syrup – 750 ml', 'Torani – Raspberry Smoothie Mix – 64 oz', 'Torani – Raspberry Syrup – 750 ml', 'Torani – Strawberry Banana Smoothie Mix – 64 oz', 'Torani – Strawberry Smoothie Mix – 64 oz', 'Torani – Strawberry Syrup – 750 ml', 'Torani – Sugar-Free Hazelnut Syrup – 750 ml', 'Torani – Sugar-Free Vanilla Syrup – 750 ml', 'Torani – Tiramisu Syrup – 750 ml', 'Torani – Vanilla Syrup – 750 ml', 'Torani – White Chocolate Sauce – 64 oz', 'Torani – White Chocolate Syrup – 750 ml', 'Torani – Wild Berry Smoothie Mix – 64 oz', 'Tropicana – 100% Orange Juice, Shelf Stable – 12/15 oz', 'Tropicana – Apple Juice – 12/32 oz', 'Twinings – English Breakfast Tea, K-Cup – 24 Ct', 'Twinings – Green, Pomegranate, Raspberry, & Strawberry Tea – 25 Ct', 'Twinings – Lemon Ginger Tea – 25 Ct', 'Twinings – Organic Cinnamon Spice Tea – 25 Ct', 'Twinings Tea – Chai Flavor – 25 ct', 'Twinings Tea – Earl Grey- 25Ct', 'Twinings Tea – English Breakfast – 25 Ct', 'Twinings Tea – English Breakfast, Decaffeinated – 25 Ct', 'Twinings Tea – Green Tea – 25Ct', 'Twinings Tea – Green Tea with Jasmine – 25 Ct', 'Twinings Tea – Pure Camomile Herbal Tea – 25Ct', 'Twinings Tea – Pure Peppermint Herbal Tea – 25 Ct', 'V8 – Vegetable Juice – 12/46 oz cans', 'V8 – Vegetable Juice Original – 28/11.5 oz cans', 'V8- Vegetable Juice – 12/12 oz plastic bottles', 'Victor Allen – Single Serve Coffee, Caramel Macchiato – 42 ct', 'Victor Allen – Single Serve Coffee, Italian Roast – 42 ct', 'Victor Allen – Single Serve Kona Coffee Blend – 42 ct', 'Victor Allen’s – Single Serve Colombian Roast Coffee – 42ct', 'Victor Allen’s – Single Serve Donut Shop Coffee – 42ct', 'Victor Allen’s – Single Serve French Roast Coffee – 42ct', 'Victor Allen’s – Single Serve Hazelnut Coffee – 42 ct', 'Victor Allen’s – Single Serve Morning Blend Coffee – 42ct', 'Victor Allen’s – Single Serve Organic Peruvian Coffee – 42 ct', 'Victor Allen’s – Single Serve Organic Peruvian Coffee – 42 ct', 'VitaminWater – Energy, Tropical Citrus Bottles, 20 fl oz, 12 Pack', 'VitaminWater – Essential, Orange-Orange Bottles, 20 fl oz, 12 Pack', 'VitaminWater – Focus, Kiwi Strawberry – 20 fl oz', 'VitaminWater – Power-C, Dragonfruit – 20 fl oz, 12 Pack', 'VitaminWater – Revive, Fruit Punch Bottles 20 fl oz', 'VitaminWater – XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack', 'VitaminWater Zero – XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack', 'Voss Water – 500 Ml', 'Voss Water – 500 Ml', 'Zing Zang – Bloody Mary Mix, 12 Pack, 32 oz']


def splitproduct(product):
    if '–' in product:
        return product.rsplit('–', 1)
    elif ',' in product:
        return product.rsplit(',', 1)
    elif '-' in product:
        return product.rsplit('-', 1)
    else:
        return [product, None]

print(list(map(splitproduct, products_small)))
# [['7-Up Soda ', ' 24/12 oz cans'],
#  ['A&W Root Beer, 12 oz cans', ' 12 pack'],
#  ['Aldi Milk', '15 gallon'],
#  ['Arizona – Arnold Palmer, Iced Tea & Lemonade ', ' 24/23 oz cans'],
#  ['Balle Balle- Kesar Mango Pulp ', ' case']]

print(list(map(splitproduct, products_large)))
# [['7-Up Soda ', ' 24/12 oz cans'],
#  ['7-Up Soda ', ' 8/2L plastic bottles'],
#  ['A&W Root Beer ', ' 24/12 oz cans'],
#  ['A&W Root Beer, 12 oz cans', ' 12 pack'],
#  ['Abuelita – Hot Cocoa Mix ', ' 6/2 lbs Bag']
#  ...
#  ['VitaminWater ', ' XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack'],
#  ['VitaminWater Zero ', ' XXX, Acai Blueberry Pomegranate Bottles, 20 fl oz, 12 Pack'],
#  ['Voss Water ', ' 500 Ml'],
#  ['Voss Water ', ' 500 Ml'],
#  ['Zing Zang ', ' Bloody Mary Mix, 12 Pack, 32 oz']]

print([x for x,y in map(splitproduct, products_large) if y is None])
# ['BANG BLUE RAZZ 16Z', 'BANG BLUE RAZZ 16Z', 'Shishito Peppers']

A better solution might be to keep a list of all possible patterns of quantities, such as '<number> oz', '<number> pack', '<number> oz cans', and extract the quantity by relying on those patterns rather than on the separator.

Upvotes: 1

Related Questions