The consumer price index rose 0.4% in February and 6% from a year ago, in line with market expectations. A drop in energy prices helped keep inflation in check, while shelter costs increased sharply.