First, slice the file so that you get the cubic centimeter reading that estimates how much plastic will be needed.
The volume of a cylinder, which is what the filament is, is:
V = pi * r^2 * h
Where r is roughly 0.875mm (depending on your filament's diameter/radius), so we can solve for h (which is the length of filament needed)
Also 0.875mm is equal to 0.0875cm
h = V/(pi * r^2)
h = V/(pi * (0.0875cm)^2)
h = V/(0.024cm^2)
Inverting that:
h = V * 41.667 cm^-2
This will vary with the radius of the filament, but it should give you a good estimate.
Note: Make sure to get a good measurement, because the difference in filament diameter changes the number. Filament with a 1.72mm diameter will give you a multiplier of 43 instead of 41.