if, sed or awk with conditions

I do not know how to do this unless I use a bunch of if statements. I need a script to replace numbers in each record in a file. I am really getting tangled in this web.
If a fieldA (19 positions) is greater than 14 digits, I have to change the data (resulting fieldA is fixed 19 postions).
If there are preceding zeros. For example:
'000123456789012 ' would be changed to '123456789012 '
'001234567890123 ' would be changed to 1234567890123 '
'012345678901234 ' would be changed to 12345678901234 '
'123456789012345 ' would not be changed but would report error

I would appreciate any help or direction. Thanks.

Something to start with:

awk 'length($0) > 14 {print "Error on this line : " $0; next}
{printf("%d\n", int($0)) > "OutFile"}' file
[house@discovery] echo "000123456789012" | sed 's/^0*//'
123456789012

Try the following script to do it.

sed -r 's/[1-9]+{15,}/Error on this line exceeding 14 digits/g;s/^0*//g;' <inputfilename>

Actually vivek raj has did that , but it has a small bug to check the 0 preceding the line.

It will not work for this input,

 123456789012345

Actually for this input the error should come.

sed -r 's/^[1-9][0-9]+{14,}/Error on this line exceeding 14 digits/g;s/^0*//g'

Thank you everyone for the various means to do it. I will work with them all in testing just to become familiar with the different coding techniques. While I was waiting for someone to respond, I was researching and tested with the following method that is working but I need to incorporate the error message which I will do from above. Thanks again.

FieldB=`echo "${FieldA}" | sed "s/^0*//"`