# Reading files into ui-table

**URL:** <https://discourse.nodered.org/t/reading-files-into-ui-table/47960>\
**Category:** General\
**Created:** [3 July 2021 04:15 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960 "2021-07-03T04:15:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trust](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@trust](https://discourse.nodered.org/u/trust)\
**Post date:** [3 July 2021 04:15 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960/1 "2021-07-03T04:15:44Z")

</div>

Newbie so still trying to understand the system.  
I've tried using the example data from ui-table written into files and used file reader to input to ui-table - it creates a blank table. The examples using inject work fine.  
Can someone please provide ANY example of reading a file directly (or through a function) into ui-table?  
Simple version just two items with one variable each would suffice.  
Thanks

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [3 July 2021 04:22 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960/2 "2021-07-03T04:22:41Z")

</div>

> [@trust](#):
>
> Can someone please provide ANY example

I always check if there are any examples included with each new contrib I install.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/bee34867a16664b7a69c779a0ac5e4485c9ba9cc.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 July 2021 15:07 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960/3 "2021-07-03T15:07:23Z")

</div>

It will depend on what you file looks like of course... but if it is something like a CSV file then maybe the CSV node will parse it into a table and if you set that to output a single array then you may be able to feed that straight into a ui\_table node

file - /tmp/a.csv

```auto
Sensor,Temp,Humidity
A1,22,58
B1,23,55
C2,19,62

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/147b6e78bd44c9a4ffb99c22645af2802fb76c26.png)

```auto
[{"id":"1214ce9370f52ffa","type":"inject","z":"ba9351cf.2e3e1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":440,"wires":[["17a96824507f88f8"]]},{"id":"17a96824507f88f8","type":"file in","z":"ba9351cf.2e3e1","name":"","filename":"/tmp/a.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":330,"y":440,"wires":[["2918850eb505b43b"]]},{"id":"2918850eb505b43b","type":"csv","z":"ba9351cf.2e3e1","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":490,"y":440,"wires":[["f76e0e9aa06e98f3"]]},{"id":"f76e0e9aa06e98f3","type":"ui_table","z":"ba9351cf.2e3e1","group":"276245e.5e9fbba","name":"","order":3,"width":0,"height":0,"columns":[],"outputs":0,"cts":false,"x":630,"y":440,"wires":[]},{"id":"276245e.5e9fbba","type":"ui_group","name":"Group1","tab":"b667c473.aed508","order":2,"disp":true,"width":"10","collapse":false},{"id":"b667c473.aed508","type":"ui_tab","name":"Tab1","icon":"dashboard","disabled":false,"hidden":false}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8af2b75b957c2f1882db897d5be2f5703a494629.png)

---

<div class="post-metadata">

**Author:** ![trust](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@trust](https://discourse.nodered.org/u/trust)\
**Post date:** [3 July 2021 16:02 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960/4 "2021-07-03T16:02:22Z")

</div>

I had tried to do exactly the same thing, and it didn't work.  
But your example helped me find the problem.  
I had set the csv output to the default - a message per row, instead of a single message [array]  
Thanks!

---

<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:** [17 July 2021 16:03 UTC](https://discourse.nodered.org/t/reading-files-into-ui-table/47960/5 "2021-07-17T16:03:05Z")

</div>

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