I had a problem similiar to that. Does the car take longer for it to start? When it begins to start, does it seem like you have to hold the starter engaged until it actually runs on its own?
If so, it could be the EGR valve. One way to identify this probem is, does the car run fine when it's cold? Or does it do this all the time? It could be your fuel filter, fuel pump, EGR, or a wiring problem.
Check your fuses and listen to the sound your fuel pump makes.
If the car runs fine in the morning or whenever it's cold, but starts acting weird when it's warmed up (or coming to a stop, or sitting at redlights/stop signs), it might be the EGR valve. A good way to see if it is, when it's spitting and sputtering and shaking, get a hammer and lightly tap the EGR valve. If it doesn't straighten up, hit it a little harder. If it still doesn't straighten up, it's not the EGR valve.