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!