Line number in Flat File

Hi,

I’m using a WM FlatFile Adaptor to generate a flatfile. I would like to know is there any way where Flatfile Schema gives the linenumber at end/begining of the line in the file generated. Does anybody encountered the same and how they resolved it.

Thanks in advance.

I would track it myself, and define a field for it. You can track it by using pub.math:addInts to add one to your counter - or you can use the $iteration variable in your loop.

To clarify Greg’s answer a bit - you should be using the iteration method of processing your file, described in the Handling Large Files section of the manual (page 34 in my version). This executes a loop once for each line in the file, allowing you to keep track of the line numbers.