# Export CSV files based on 1st of Month

**URL:** <https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586>\
**Category:** General\
**Created:** [27 April 2020 03:10 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586 "2020-04-27T03:10:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michilson](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Michilson](https://discourse.nodered.org/u/Michilson)\
**Post date:** [27 April 2020 03:10 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586/1 "2020-04-27T03:10:12Z")

</div>

![CSV FLow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/8246045bf73a33eac7d9309e44c9318e32140a96.png)

Hello all,

I am a new Node Red User and I am looking to export/log sensor data to a CSV file. I'd like to start a new file on the 1st of each month.

The flow show posts data every 15 min. currently temp and humidity.

I'd like for the file to include all header data, (Date/Time, Temp, Humidity) and the File Name to be Year Month. ie (2020-April-Irrigation History.csv)

Can someone please help me to trigger the Template file, Adjust the Name, And move the file into a separate Directory. for the CSV export.

Node Red is running on Rasberry Pi, Sensor Data is from MQTT.

Thanks for the help.  
Mike C

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [27 April 2020 03:40 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586/2 "2020-04-27T03:40:10Z")

</div>

To start, have you had a look at any of the scheduling nodes to determine which would suit your needs? There are quite a few to choose from.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 April 2020 15:48 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586/3 "2020-04-27T15:48:14Z")

</div>

> [@Michilson](#):
>
> Can someone please help me to trigger the Template

node-red-contrib-cron-plus or node-red-contrib-bigtimer or inject node

> [@Michilson](#):
>
> Adjust the Name

change node or function node

> [@Michilson](#):
>
> And move the file into a separate Directory

node-red-contrib-fs-ops

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [27 April 2020 17:22 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586/4 "2020-04-27T17:22:08Z")

</div>

Additionally to the previous replies. You could use a change node with below configuration to generate the dynamic file name (required by the file node).

 ![a-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/44bb4d841d322d2c4839247497e7919f1a8b8a41.png)

![a-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/cab94dcdb4f6e58cd69d58849cab6c7c5db13790.png)

---

<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:** [26 June 2020 17:22 UTC](https://discourse.nodered.org/t/export-csv-files-based-on-1st-of-month/25586/5 "2020-06-26T17:22:09Z")

</div>

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