CHESTERTOWN, N.Y. — At the Tops Market on Main Street recently, there was a “Mega Meat Sale” — buy one pork chop and get another free.

There were specials on avocados, paper towels and fried fish. Craft beer shared shelf space in the brightly lit store with cases of Genesee, a local favorite.

[Fairway Market closing? Speculation abounds over New York institution.]

Tops was cutting prices even though it had filed for bankruptcy last month, responding to pressure from behemoths like Amazon and Walmart — which are lowering prices and targeting new markets — and from discount stores like Dollar General. The food war that is raging across the country is weeding out the weakest links, leaving small and medium-size grocery companies struggling to stay afloat.

It wasn’t long before another wobbly chain followed Tops into bankruptcy. The parent company of the Southern stores Winn-Dixie and Bi-Lo said it would file for Chapter 11 protection by the end of this month, and close 94 stores.