For smooth wall, plain end pipe, here's what to do:
Rearrange the formula for calculating volume in bbls/ft or cubic meters/meter. If you have the o.d. and weight per unit length you can determine the i.d. Or, if you have the o.d & i.d. you can calculate the volume and multiply that by the weight/cu.ft. or cu.m depending on the system you are working in, to get the weight per unit length.
Example in English units
Steel weighs 2,747lbs/bbl
volume in bbls/ft = (o.d.squared-i.d. squared)/1029.4
unit wt in lbs/ft = 2.68(o.d. squared-i.d. squared)
You can use the same process for drill pipe. Just figure the pipe body and connections separately. Get the total weight of the joint and divide by the length for the correct weight per unit volume.