# Converting data from CSV file

**URL:** <https://discourse.nodered.org/t/converting-data-from-csv-file/36394>\
**Category:** General\
**Created:** [23 November 2020 12:23 UTC](https://discourse.nodered.org/t/converting-data-from-csv-file/36394 "2020-11-23T12:23:48Z")\
**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:** [23 November 2020 12:23 UTC](https://discourse.nodered.org/t/converting-data-from-csv-file/36394/1 "2020-11-23T12:23:48Z")

</div>

Hello

I am importing data from a CSV file using the csv parser and that all work great.

My problem is that I want to convert the timestamp of the data into something I can use in influxdb.  
This is how it looks from the file.  
201105104117 converted it's YYMMDDHHmmSS

How should I go about doing this?

---

<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:** [23 November 2020 13:19 UTC](https://discourse.nodered.org/t/converting-data-from-csv-file/36394/2 "2020-11-23T13:19:50Z")

</div>

The change node has the $moment function built in so you can use it to help parse like this

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

```auto
[{"id":"54c46ebe.3b623","type":"change","z":"ab9333b5.f44f6","name":"Change node","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment(payload,\"YYMMDDHHmmSS\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":2120,"wires":[["2c896b1f.98a694"]]}]

```

---

<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:** [23 November 2020 13:29 UTC](https://discourse.nodered.org/t/converting-data-from-csv-file/36394/3 "2020-11-23T13:29:59Z")

</div>

Thanks a lot for the help.

---

<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:** [7 December 2020 13:30 UTC](https://discourse.nodered.org/t/converting-data-from-csv-file/36394/4 "2020-12-07T13:30:06Z")

</div>

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