# Counts the data

**URL:** <https://discourse.nodered.org/t/counts-the-data/53237>\
**Category:** General\
**Created:** [4 November 2021 21:28 UTC](https://discourse.nodered.org/t/counts-the-data/53237 "2021-11-04T21:28:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [4 November 2021 21:28 UTC](https://discourse.nodered.org/t/counts-the-data/53237/1 "2021-11-04T21:28:39Z")

</div>

Hello!

I am using node-red-contrib-fs to read files from a folder.

There is the possibility that he counts the data and then writes it into a value (msg.count) e.g. 1 of 10, 2 of 10, 3 of 10 and so on.

---

<div class="post-metadata">

**Author:** ![PiMo131](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pimo131/32/34978_2.png) [@PiMo131](https://discourse.nodered.org/u/PiMo131)\
**Post date:** [6 November 2021 00:06 UTC](https://discourse.nodered.org/t/counts-the-data/53237/2 "2021-11-06T00:06:40Z")

</div>

Try using the the timed counter.

Move the msg.payload lenght to msg.topic.

The timed counter can count per msg.topic.

> **[node-red-contrib-timed-counter](https://flows.nodered.org/node/node-red-contrib-timed-counter)**
>
> A Node-RED node that counts messages received in a specified time limit

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 January 2022 00:07 UTC](https://discourse.nodered.org/t/counts-the-data/53237/3 "2022-01-05T00:07:13Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
