This will allow for multiple blanks between paragraphs, or even preceding your first paragraph. Of course, your data will never be like that, and it will never be important for the paragraph-numbers to actually be correct. However, just in case it is so for someone else.
BEGIN {
ParaNum = 1
MultiBlankRecNum = 0
}
{
if ( NF == 0 ) {
if ( NR > ( MultiBlankRecNum + 1 ) ) {
++ParaNum
}
print
MultiBlankRecNum = NR
next
}
print ParaNum, $0
}
For a bit more fun, this prefixes the paragraph, line within paragraph, then the text line within the file, and the record-number within the file, running count of words and words on the line.
BEGIN {
ParaNum = 1
TextLineInFile = 0
TextLineInPara = 0
MultiBlankRecNum = 0
WordsRunningTotal = 0
}
{
if ( NF == 0 ) {
if ( NR > ( MultiBlankRecNum + 1 ) ) {
++ParaNum
}
print $0
MultiBlankRecNum = NR
TextLineInPara = 0
next
}
++TextLineInPara
++TextLineInFile
print ParaNum "." TextLineInPara, TextLineInFile "/" FNR, NF "/" WordsRunningTotal, $0
WordsRunningTotal += NF
}