cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a custom Header in a file?

anivtk
New Contributor II

Hi,

I am reading some table data from a SQL Server (‘SQL Server - Execute’ snap) and writing the output to a text file (‘File Writer’ snap) (using a ‘CSV formatter’ between he above snaps)

‘SQL Server - Execute’ → ‘CSV formatter’ → ‘File Writer’

Requirement

  1. I don’t need the SQL column name name as the header ==> I am able to achieve this by unchecking “Write CSV header” in ‘CSV Formatter’
  2. But I need a new heading (instead of the column name) which is would be the “number of records returned by the SQL query”.

i.e. If the SQL query returns 99 records, the file should look like

99
Row 1
Row 2
Row 3


Row 99

Any help on how can I achieve this is appreciated.

Thanks!

1 ACCEPTED SOLUTION

Supratim
Contributor III
2 REPLIES 2

Supratim
Contributor III

@anivtk

try attached pipeline. rowCountWriteToFile_2020_09_30.slp (13.1 KB)

anivtk
New Contributor II

This is great, met my requirements, thanks for your quick response!