Knight-Ridder Inc., publisher of The Miami Herald and 29 other newspapers, said Friday it expects to sell its eight television stations for more than $400 million.

Knight-Ridder, which had announced plans to sell the properties in October, also said it expects to post a gain in 1989 in excess of $125 million before taxes on the deal. That gain most likely will come in the second quarter, company spokesman Frank Hawkins said.Hagins said Knight-Ridder chose to make the announcement because some of the stations have been sold.