Just did this on the wagon...be forewarned that the commonly available aftermarket cables (pioneer) need to be checked for correct core length. I recently replaced the OE cable assembly, which had become very sloppy (speedo jumping around, til the day it wouldn't register over 28 MPH). The first one I installed lasted about 120 miles. Everything was working fine, then on turnpike, speedo went from 75 to 35 to 65 then 0. When I pulled the cable at the trans end, there was a piece of the core broken off in the driven gear, and a ball of wound-up core in the end of the fitting.
When I installed the second one, I installed it to the speedo head first, then routed it on the original path, and pulled the driven gear and sleeve out of the trans. I then pulled the driven gear out of the sleeve, screwed the cable on to the sleeve and attempted to install the driven gear into the sleeve. It would not fully bottom in the sleeve, it was about 1/4 inch from fully seating. I wound up cutting about 3/8" (10mm) off of the core and deburring it, rechecked the fit, and closed it up. Have about 220 miles on the second one, so far so good.
My theory is that the first replacement was also too long, and was operating in a bind the entire time, until it wrapped up the excess and twisted itself in two. I was somewhat surprised that it had not broken the plastic driven gear, as the stem is pretty thin, but it had broken the core at the end of the stem, with a piece still in the gear.
If yours is routed like mine was, you will want to pull the LF fender liner out or at least down all the way to properly route the replacement cable, as it runs behind the liner and has a retainer clipped to the gusset for one of the liner bolts.