# Reading data from file

**URL:** <https://discourse.nodered.org/t/reading-data-from-file/38364>\
**Category:** General\
**Created:** [1 January 2021 17:33 UTC](https://discourse.nodered.org/t/reading-data-from-file/38364 "2021-01-01T17:33:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![T0mmy](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@T0mmy](https://discourse.nodered.org/u/T0mmy)\
**Post date:** [1 January 2021 17:33 UTC](https://discourse.nodered.org/t/reading-data-from-file/38364/1 "2021-01-01T17:33:26Z")

</div>

Hi

I am reading data from a CSV file and shipping it into influx.  
I have made a flow that is working, it's a bit ruff and I could use some help finishen up.

My flow looks like this.

 ![Udklip](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e7e6aee2ad175aa1e413ef2dc9d9fd04361e9f3f.png)

My problem is that this setup is needed for every type of unit I have making a CSV file.  
My CSV file looks like this.

```auto
200923224515	654216315	Serial-number	Firmware-Number	1	46	-61	89450100170913022654	382	14	0

200923214603	167.101	247.755	0	0	0	0	0.05	0.001	8.051000	19.280001	0	0	0	0	0	0	0	0	3.86	0	0	0	0
200923214703	166.648	247.56	0	0	0	0	0.036	0.001	8.061000	19.280001	0	0	0	0	0	0	0	0	3.86	0	0	0	0

```

The serial number is the units name, but depending on the firmware-number, the data I need to read is different, so after the long explanation, my question is as follows.

Is there a way to make a setup, so it is read the data depending on what the firmware number is?  
And happy new year to all 🙂

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [1 January 2021 20:24 UTC](https://discourse.nodered.org/t/reading-data-from-file/38364/2 "2021-01-01T20:24:27Z")

</div>

Read the data in and after the `file.in` node, put a `switch` node.

Use the `msg.firmware` field to route the message.

If you don't understand this, put a `debug` node just after the `file.in` node and show the entire message.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![T0mmy](https://avatars.discourse-cdn.com/v4/letter/t/ec9cab/32.png) [@T0mmy](https://discourse.nodered.org/u/T0mmy)\
**Post date:** [1 January 2021 20:58 UTC](https://discourse.nodered.org/t/reading-data-from-file/38364/3 "2021-01-01T20:58:26Z")

</div>

Thanks a lot, that was it and a simple one as well 🙂

---

<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:** [15 January 2021 20:58 UTC](https://discourse.nodered.org/t/reading-data-from-file/38364/4 "2021-01-15T20:58:42Z")

</div>

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