Pretty much all shift, throttle and even steering cables have the length stamped into the covering of the cable near each end.
Heres an explanation from Jamestown Distributors:
The control cable part number contains its length. Teleflex cables are usually listed as CC???XX, where XX = length in feet. Morse cables are listed as ??????-??-XXX.0, where XXX.0 = length in inches.
For example:
Part Number CC63320 = 20 ft. CC633 Control Cable or Part Number 032377-03-240.0 = 20 ft. 33C Control Cable (240" = 20')
Heres a giant pic (sorry it was the only one I could find) I found for example. This is a teleflex steering cable and it would be 16'.