Pity the poor shop girl and stock boy, for soon they will follow in the footsteps of the coal miner and autoworker.

Former factory workers and coal miners have roiled American politics in recent years, angered and activated by lousy retraining programs and cuts in public assistance. U.S. auto manufacturing jobs dropped from 1.3 million in 2000 to 942,000 last month, according to the Bureau of Labor Statistics. The number of coal miners has dropped from 70,000 in 2003 to 65,400 in 2015.

U.S. retailers have shed 89,000 jobs since October alone, according to federal statistics. Fourteen retail chains have filed for bankruptcy in the first quarter of this year, according to an analysis by S&P Global Market Intelligence. Investment bank Credit Suisse reports that retailers have announced 2,880 store closures in the same period, and analysts predict 8,640 stores will close this year.

Tens of thousands of layoffs are on the way.

While experts debate whether manufacturing and mining jobs were lost due to automation or international trade, there is little doubt that retail stores are closing because shoppers are buying more online. Consumers shifted $40 billion in spending from the shopping mall to e-commerce sites last year.

"Stores are closing because of the rise of e-commerce and shifts in how people spend their money," said Deb Gabor, CEO of Sol Marketing a brand/retail strategy consultancy. "Shoppers are devoting bigger shares of their wallets to entertainment, restaurants and technology, and spending less on clothing and accessories."

Urban Outfitters CEO Richard Hayne told investors during a conference call that retailers built too many stores as internet shopping took off.

"This created a bubble, and like housing, that bubble has now burst," Hayne said. "We are seeing the results: Doors shuttering and rents retreating. This trend will continue for the foreseeable future and may even accelerate."

Market research firm Gordon Haskett surveyed American families about their shopping habits and found that Amazon sells more than all other e-commerce sites combined. Traditional brick-and-mortar locations held their own, though, in groceries, household products, health and beauty goods, and pet products, researchers found.

"The brick and mortar's biggest advantage is in groceries and household products (i.e., laundry detergent, diapers, toothpaste, cleaners, etc.) suggesting respondents still visit retail locations for the majority of their non-discretionary items," the report said.

That explains why Amazon is buying Whole Foods and wants to convince more Americans to buy groceries and household products from it. If Amazon succeeds, the fate for retail workers is clear: massive unemployment.

Amazon's distribution centers are largely automated, offering few jobs compared to those lost. And average retail workers, who earn little more than minimum wage plus commission, do not typically have any advanced training or higher education that qualifies them to fill vacant high-tech jobs.

Leaving displaced workers to fend for themselves is not an option after the voter anger we saw in last year's election. But retraining low-skilled, low-income workers has always been a staggering challenge because they often don't have sufficient savings, reliable transportation or a stable home life.

"Money, transportation and family, particularly single parents, those are the tough issues," said Linda Head, associate vice chancellor at Lone Star Community College for workforce education. "People who are working in retail are going to need to do something different, and they need to figure out where their aptitude is, and what their interest is. And they are going to need to do something quickly."

Community colleges work with local employers and state officials to create training programs. Lone Star has six- to eight-week training programs designed to meet the needs of oil field services companies, trucking companies and health care companies that can lead to immediate employment.

"We really want employers who are laying off employees to contact us and work with us to help with their downsizing," Head said. "Let us help to retrain these workers and get them into the right programs."

Community colleges, though, need help providing transportation to get students to the right campus, to help students pay for child care, and to cover tuition and program costs, Head said. The state can contribute $2,000 toward retraining someone, but an eight-week certification program costs $4,200. Many unemployed people can't make up the difference on their own, so they need assistance.

"We don't offer training unless there is a job at the end, so invest in us," Head added.

Now, I know it's fashionable in Austin and Washington to cut spending on higher education in order to cut taxes on the wealthy. But we can see this unemployment storm coming, and we have time to prepare and help people who are losing their jobs through no fault of their own.

Keeping people employed is a sound investment that pays off in lower demands on government programs and higher economic activity. Let's invest to keep people working, and in so doing, boost the American economy.