Skip to main content
simply more productive

The Data Specialist

Thanks to our intuitive transformation designer, you can convert data effortlessly to a variety of formats without knowing how to program. It’s not only efficient, it’s also easy to use.
Up to 100,000 records can be processed with the freeware version!
Flowheater Chart

Row count

More
12 years 3 months ago #2246 by Gennaro
Row count - Post(2246) was created by Gennaro
Hi!
i was wandering if is it possible:

- to count the total number of rows of a text file on the read side
and then
- to use the result (total number) as output to a filed on the write side

any suggestions?

thanks in advance

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #2247 by FlowHeater-Team
Replied by FlowHeater-Team on topic Re:Row count - Post(2247)
Hi Genaro,

Yes, it is! If you want to add the line count to each row you have to use the power of the .NET Heater and the following little script. In the attachment you’ll find an example.
Code:
int rows = -1; public object DoWork() { // only read the input file one time if (rows < 0) { // Getting the READ Adapter TextFileAdapter adapter = (TextFileAdapter)AdapterRead; // Read all lines string [] lines = File.ReadAllLines(adapter.Filename); // adopt the line count rows = lines.Length; } return rows; }

If you want to add the line count to a Header/Footer row you can find an example here. Processing of CSV header and footer rows

Attachment counting_rows.zip not found


Best wishes
Robert Stark

Please Log in or Create an account to join the conversation.

Time to create page: 0.253 seconds
FlowHeater Logo

FlowHeater - The Data Specialist

Efficient data integration and transformation with FlowHeater – the perfect solution for a seamless transfer of your data.

Legal information

Support & Contact

Contact

Phone:
0951 / 9933 9792

eMail:
This email address is being protected from spambots. You need JavaScript enabled to view it.


Copyright © 2009-2024 by FlowHeater GmbH. All rights reserved.