Hope you are doing well.

Please use below command to count number of records
a = load 'file'...
b = group a ALL;
 c = foreach b generate COUNT(a);

Please refer below screen shot for your reference.





Hope it resolves your query.
If you have any further query,please let us know.

Please share your feedback by choosing either of smiley's.