finding & replacing blank rows/spaces in a file

Can anyone help me find and replace blank rows in a file with a numeric value (ie blankrow=someTxtOrNumValue), the file is over 500,000 rows long so it would need to be the quickest way as I'll need to do this for multiple files...I would be greatfull for any suggestions....thanks

sample file:
..............
J Smith
A Allan
B

fred
Tommy D
John Hall
.............

Try...

awk '{print NF ? $0 : blankrow}' blankrow="someTxtOrNumValue" file1 > file2

Thanks that works a treat, now I need to replace all the rows that have the number 0 with a text value like....(0=ASC) and I'll be done, I have read through the my man pages on awk and I can't understand them too well, what does the "NF ?" part do, I assume thats where it's search for empty rows so I tried changing it to "Nf 0" but that gave me errors as you would expect...