The largest increase in grocery store prices in 41/2 years sent consumer prices up 0.4 percent in July, a solid quickening in inflation analysts had expected, the Labor Department reported Tuesday.

If consumer prices continue to rise at July's 0.4 percent seasonally adjusted pace, inflation for the entire year would be 5.2 percent, the bureau reported. For the first seven months of this year, inflation has been running at 4.5 percent, compared with 4.4 percent for all of 1987.Food prices overall advanced 0.9 percent in July as the effects of the long summer drought began to make their way to the consumer, even though meat prices were 2.2 percent lower because drought-stricken ranchers sold cattle early to save feed costs.

Grocery store food prices jumped 1.4 percent, the largest advance since January 1984, the Bureau of Labor Statistics said. More than three-quarters of this advance was due to sharply higher prices for fresh fruits and vegetables, up 4.7 percent, poultry, up 7.4 percent, and eggs, up 9.6 percent.

"Inflation is on its way up," David Wyss, chief economist for Data Resources Inc. of Lexington, Mass., said Monday, forecasting a 0.5 percent rise. "Nothing sudden, no big jumps, but steady across-the-board increases."

"The (lower) meat prices could hide what's happening," he said.

A 0.7 percent increase in the cost of gasoline sent energy prices up after a decline in June, the bureau reported.

Donald Ratajczak, chief economist for the Georgia State University economic forecasting project, said the report is indicative "of the kind of inflation rates we'll see for the rest of the year."

The report generally is reassuring to the policy-makers "because it shows the base rate of inflation is fairly stable. The people in the grocery stores are going to be in shock," he said. "The grocery store and the gas station are the places (people) see prices most frequently."

Excluding volatile food and energy prices, consumer prices climbed a relatively modest 0.3 percent in July after adjustments for seasonal variations.

The overall 0.4 percent increase follows 0.3 percent jumps in May and June and matches a 0.4 percent increase in April. The increase in March was 0.5 percent, the bureau said.