* TSX ends up 0.2% at 21,255.61

* Posts its highest close since April 2022

* Materials sector adds 0.9% as copper rallies

* Technology falls 1.2%

Feb 16 (Reuters) - Canada's main stock index rose to its highest level in nearly two years on Friday, helped by gains for resource shares, as investors bet that the U.S. economy was headed for a soft landing despite recent hotter-than-expected inflation data.

The Toronto Stock Exchange's S&P/TSX composite index ended up 32.92 points, or 0.2%, at 21,255.61, its highest closing level since April 2022. For the week, the index was up 1.2%, snapping a two-week losing streak.

"It does look like both sides of the border the price action points to buying on the dip," said Elvis Picardo, portfolio manager at Luft Financial, iA Private Wealth. "The trigger for that is because the soft landing in the U.S. is very much in play."

U.S. producer prices increased more than expected in January, giving Federal Reserve policymakers fresh validation for their wait-and-see approach to cutting interest rates. It follows hotter-than-expected U.S. consumer price data on Tuesday.

"Even though we've got a couple of strong inflation prints in the U.S, the expectation continues to be the trend is lower for inflation," Picardo said.

Canada sends about 75% of its exports to the United States, including commodities.

The materials group, which includes precious and base metals miners and fertilizer companies, added 0.9% as gold and copper prices rose.

Energy also ended up, gaining 0.5%, as the price of oil settled 1.5% higher at $79.19 a barrel.

Technology fell 1.2%, cutting the sector's advance since the start of the year to 6.9%.

Air Canada was among the biggest decliners. Its shares fell 6.5% after the company reported a wider-than-expected adjusted quarterly loss.

The TSX is set to be closed on Monday for the Family Day holiday. (Reporting by Fergal Smith in Toronto and Purvi Agarwal in Bengaluru; Editing by Shweta Agarwal and Diane Craft)