LakshmiPravallikaAccepted solution
Community Advisor
Jun 8, 2023 8:25 AM UTC
Hi @dandrews2 ,
It is possible to get the count of records at the first line of the file.
Please follow the below steps after the Data Extraction (File generation).
Example Workflow

After the File generation please add these 3 unix commands to add the header to the output file.
var result = execCommand('echo "'+vars.recCount+'" > fullpath/temp_file.csv');
logInfo("Result"+result);
execCommand('cat '+vars.filename+' >> Path/temp_file.csv');
execCommand('mv fullPath/temp_file.csv '+vars.filename+'');
Then the Output file will be generated with the count of records as the first line in the final file.
PFA Screenshot below:

Regards,
Pravallika.