# Data logging in windows PC (.csv)

**URL:** <https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453>\
**Category:** General\
**Tags:** function-node\
**Created:** [28 June 2023 07:24 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453 "2023-06-28T07:24:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganeshiac](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@ganeshiac](https://discourse.nodered.org/u/ganeshiac)\
**Post date:** [28 June 2023 07:24 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/1 "2023-06-28T07:24:17Z")

</div>

Hi everyone,  
I want to store live data in windows PC via .csv file format. In this file every day change new file with date and time . Do you have any sample flow code for that. Please support how to write .csv file. Here, I am using windows 10 Pc.

---

<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:** [28 June 2023 07:36 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/2 "2023-06-28T07:36:09Z")

</div>

This has been asked & answered a lot but I appreciate the search terms might make is difficult to find.

Try searching **daily filename** in the forum, it turns up a few solutions.

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [28 June 2023 07:56 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/3 "2023-06-28T07:56:56Z")

</div>

I understand CSV might look like a good solution, but I have to deal with those every now and then, and in my opinion it is much better and more efficient to set up a mySQL DB on the PC and use it to store any logs you want. They can be retrieved easily, and they can be accessed both for reading and writing by multiple users (more or less) simultaneously. They can be indexed by several fields, and the results are easy to filter if you need to.

Unlike a DB, a CSV file will throw an error if you attempt to read and write at the same time, and if you have a lot of data it can be extremely cumbersome to filter and search the results you need, specially if those are non-consecutive.

If I were you, I'd go for a DB instead of CSV without even thinking. I've had enough trouble in my industrial applications because of companies that decided to log everything in .csv files that are nearly useless to retrieve specific data (as in, how much time the machine has been up and running?).

Anyway, it's your choice, but that is my advice. It will save you some problems down the line, unless you're planning on not checking the logs ever.

---

<div class="post-metadata">

**Author:** ![ganeshiac](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@ganeshiac](https://discourse.nodered.org/u/ganeshiac)\
**Post date:** [28 June 2023 08:10 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/4 "2023-06-28T08:10:34Z")

</div>

Hi OriolFM,  
Thank you so much to sharing this information while, mySQL DB installing process consume more time. Also, I want know the mySQL DB install procedure and how to send data to mySQL DB via node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 June 2023 10:03 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/5 "2023-06-28T10:03:02Z")

</div>

How to install mysql is not a node-red issue.

In node-red, to access the db you can search the node-red flows site. In particular there is [node-red-node-mysql](https://flows.nodered.org/node/node-red-node-mysql)

---

<div class="post-metadata">

**Author:** ![ganeshiac](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@ganeshiac](https://discourse.nodered.org/u/ganeshiac)\
**Post date:** [28 June 2023 10:28 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/6 "2023-06-28T10:28:17Z")

</div>

Hi Colin,

```
       Thank you. I will check and revert back.

```

---

<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:** [27 August 2023 10:28 UTC](https://discourse.nodered.org/t/data-logging-in-windows-pc-csv/79453/7 "2023-08-27T10:28:41Z")

</div>

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