# Read data from CSV file to global variables

**URL:** <https://discourse.nodered.org/t/read-data-from-csv-file-to-global-variables/19224>\
**Category:** General\
**Created:** [16 December 2019 11:47 UTC](https://discourse.nodered.org/t/read-data-from-csv-file-to-global-variables/19224 "2019-12-16T11:47:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kundepuu](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kundepuu](https://discourse.nodered.org/u/Kundepuu)\
**Post date:** [16 December 2019 11:47 UTC](https://discourse.nodered.org/t/read-data-from-csv-file-to-global-variables/19224/1 "2019-12-16T11:47:36Z")

</div>

I have CSV data file and I want to read data to global variables line by line on time . Data is every 2 hours daily and I need some 30 days to read and set values to control dry aging chamber(simulate natural dry aging).  
What is the simplest and the best way to do?  
Columns in the file are Year/Day/Month/Time/Pressure/Humidity/Temperature/Wind speed  
Date and time can be converted to suitable if needed.  
So when start to reading values it will be set as Start time and after every 2 hours need to read correspond row values to global variables and set controller values

| 2019 | 1 | 2 | 00:00 | 1021,4 | 84 | -18,5 | 0,8 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 2019 | 1 | 2 | 02:00 | 1022,2 | 90 | -18,3 | 0,3 |
| 2019 | 1 | 2 | 04:00 | 1022,7 | 84 | -17,7 | 0,8 |
| 2019 | 1 | 2 | 06:00 | 1023,6 | 85 | -17,5 | 0,5 |
| 2019 | 1 | 2 | 08:00 | 1024,2 | 85 | -16,8 | 2,1 |
| 2019 | 1 | 2 | 10:00 | 1025,2 | 80 | -15,6 | 0,7 |
| 2019 | 1 | 2 | 12:00 | 1025,9 | 81 | -18,1 | 0,4 |
| 2019 | 1 | 2 | 14:00 | 1027,1 | 79 | -25,3 | 0,6 |
| 2019 | 1 | 2 | 16:00 | 1027,8 | 80 | -24,2 | 0,8 |
| 2019 | 1 | 2 | 18:00 | 1028,8 | 75 | -27,4 | 0,8 |
| 2019 | 1 | 2 | 20:00 | 1029,7 | 74 | -29,6 | 0,9 |
| 2019 | 1 | 2 | 22:00 | 1030,6 | 76 | -30,7 | 1,9 |
| 2019 | 2 | 2 | 00:00 | 1031,3 | 75 | -30,6 | 1,3 |
| 2019 | 2 | 2 | 02:00 | 1031,6 | 75 | -31,8 | 0,8 |

br  
Hannu

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 December 2019 12:18 UTC](https://discourse.nodered.org/t/read-data-from-csv-file-to-global-variables/19224/2 "2019-12-16T12:18:41Z")

</div>

Why read the entire file and store the entire table in a json object?
