Multiplying lines of file that contain certain letter by value

I am trying to remove the last letter in a file and then multiply each line (which contained this letter) by 500. This is what I have:

1499998A
1222222A
1325804A
1254556
     1235
     9998
      777

[FONT=&quot]

cat /tmp/listzz |gawk '{print $4}'|gawk  '{gsub(/[A]/, ""); print }

This removes the A but then I can not multiply the lines that had the A with 500.

I was able to pass the file through a variable - var

if [[ "$var" =~ A ]]; then echo "found it";else echo "no";fi

and it will find the A, but I am not sure how to multiply the lines that had the A by 500. I don't want any of the other lines multiplied.

Does someone have a suggestion?

This is what I need:

  1. find lines with A and delete the A - which is always at the end of file
  2. then multiply those lines only by 500
  3. The rest of the lines that don't contain the A should not be multiplied.

Try:

awk '$1~/A$/{$1*=500}1' file

This is with the number in the first column. If it is in the 4th column, you could try:

awk '$4~/A$/{$4*=500}1' file