Apart from few great suggestions above, There is CountText
processor which is simple enough if your csv is properly formatted and terminated with newlines. This processor will count the number of lines present in the incoming text. It provides attributes such as -
Name Description
text.line.count The number of lines of text present in the FlowFile
content
text.line.nonempty.count The number of lines of text (with at least one non-
whitespace character) present in the original
FlowFile
text.word.count The number of words present in the original
FlowFile
text.character.count The number of characters (given the specified
character encoding) present in the original FlowFile
You can easily grab this attributes in PutEmail
processors or even update the filename with count using expression language variables. For e.g use UpdateAttribute to update filename to "FooBar_"${text.line.count}.csv