TRW Inc., the Cleveland-based defense, energy and automotive products company, announced a major corporate restructuring yesterday that includes the repurchase of up to 8 million shares and the sale of its aircraft components and industrial products groups.

TRW Chairman Ruben F. Mettler said the restructuring is designed to enhance the value of the company's shares by concentrating on "our most promising businesses." Analysts said the most promising businesses are TRW's electronics operations geared to space and defense applications.

TRW shares soared in response to the announcement yesterday, closing at 82, up 5 1/8.

The company also said yesterday it will take "aggressive steps" to reduce overhead costs and take a $170 million ($4.40 a share) after-tax charge to earnings in the third quarter for estimated losses in connection with the restructuring. TRW said its third-quarter earnings would be between $1.40 a share and $1.65 a share exclusive of the restructuring, versus $2.04 a share in the third quarter last year.

In 1984, TRW earned $266.8 million ($6.96 a share) on sales of $6.1 billion versus earnings of $205.2 million ($5.36 a share) on sales of $5.5 billion in 1983. The company, which says it has built more satellites than any of its competitors, has about 93,000 employes worldwide.

"This is a very positive move to direct TRW's assets to electronics, space and the high-technology end of automobile products," one industry analyst said. "Operating profits in the segment put up for sale have trended downward. In 1981, operating profit in that segment was $220 million, and this year they have been going at about an $80 million rate."

TRW said the aircraft components and industrial products businesses it plans to sell had combined sales of about $700 million last year. Although the company is not getting out of the energy business yet, TRW said its energy products group will "report directly to the chief executive officer pending further evaluation of its strategic plans."

TRW's plan to repurchase up to 8 million, or about 22 percent, of its shares is unusual because the company will conduct a special buyback known as a "dutch auction."

Under the buyback program which begins on Tuesday, TRW shareholders will be invited to tender their shares to the company at whatever prices they specify between $80 and $88 a share.

TRW will then select a purchase price and buy at least 5 million shares tendered at or below that price.

The company said it may, but will not be obligated to, select a purchase price enabling it to buy up to 8 million shares.

The company said the dutch auction buyback offer will expire at midnight on Tuesday Oct. 15 and is not conditioned on any minimum number of shares being tendered. Initial funding for the approximately $500 million buyback program will come from existing cash and short-term credit.