Script to sort your google document grocery list in order it's in the shelves in the supermarket.
Edit the list of groceries in the order you want it in your script. Only name the name of the product and not the amounts in the script. Your grocery list can have amounts. 1 product per line.
In google docs go to extensions then click apps script. Copy paste the script and save. Put your cursor at the top and press run. Give the script access to your drive when asked. Go back to the document and select your groceries, go to extensions and open the new dropdown and press start. It's now sorted.