Hello and welcome to e health forum.
The average healthy person will pass gas about produce an average of half a liter of gas, though some people can produce a liter or more if they consume certain foods.
When malabsorption (reduced food absorption) occurs due to certain medical conditions, excess gas in the intestines and excessive flatulence (farting) is seen. Some conditions include - diverticulosis (with an overgrowth of bacteria), Celiac sprue, pancreatic diseases, lactose intolerance, Giardiasis,
First and foremost, you need to avoid foods that make your symptoms increase. Foods like asparagus, beans, broccoli, brussel sprouts, cabbage, carrots, cauliflower, celery, lentils, onions, peas, should be reduced. Dairy products like cheese, icecream, and milk, should be reduced in consumption.
Adopting a healthy dietary practices and a good exercise regimen will also improve your intestinal motility.
In addition, taking probiotic supplements and activated charcoal tablets (Charcoal, Charcocaps), will help in relieving your symptoms to a certain extent.
I hope this helps.