# Changing Column Separator dynamically for CSV node

**URL:** <https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472>\
**Category:** General\
**Created:** [4 November 2019 05:41 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472 "2019-11-04T05:41:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rueben](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rueben](https://discourse.nodered.org/u/rueben)\
**Post date:** [4 November 2019 05:41 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/1 "2019-11-04T05:41:49Z")

</div>

Hi,

I would like to know if it is possible to set the Separator value to be dynamic (or link it to a global environment variable)?

Example, I want the first 2 columns separator to be (lets say) 5 spaces, and the separator for the next 2 columns to be a string ";;".

{Column1} {Column2};;{Column3}

Thanks

---

<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:** [4 November 2019 07:48 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/2 "2019-11-04T07:48:12Z")

</div>

No. I'm afraid that's not possible. That also isn't a CSV like file. You would need to preprocess it first, maybe changing the 5 spaces into another ;

---

<div class="post-metadata">

**Author:** ![rueben](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rueben](https://discourse.nodered.org/u/rueben)\
**Post date:** [4 November 2019 09:34 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/3 "2019-11-04T09:34:55Z")

</div>

Thanks, does that mean we cannot change any properties of any nodes to be replaced by a variable? For example- the column names of the csv node?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [4 November 2019 09:44 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/4 "2019-11-04T09:44:10Z")

</div>

the details of what properties for a node can be overridden by the incoming message object are listed in the info panel for the node

---

<div class="post-metadata">

**Author:** ![rueben](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rueben](https://discourse.nodered.org/u/rueben)\
**Post date:** [4 November 2019 09:46 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/5 "2019-11-04T09:46:59Z")

</div>

> [@rueben](#):
>
> the column names of the csv no

Yup, but the column property of the csv node is not a part of the incoming messages listed in info. I thought, it would still be possible to access it somehow?

---

<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:** [4 November 2019 09:52 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/6 "2019-11-04T09:52:37Z")

</div>

you can use [environment variables](https://nodered.org/docs/user-guide/environment-variables) to set them at start time - but not dynamically no.  
Or you can just leave blank and they will get automatically assigned col1,col2,col3 etc - and you can then rename them afterwards if you like.

---

<div class="post-metadata">

**Author:** ![rueben](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rueben](https://discourse.nodered.org/u/rueben)\
**Post date:** [4 November 2019 09:58 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/7 "2019-11-04T09:58:17Z")

</div>

> [@dceejay](#):
>
> em afterwards if

rename the column names afterwards? how?  
Or you mean manually enter the column names in the csv node later on?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [4 November 2019 11:17 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/8 "2019-11-04T11:17:33Z")

</div>

It looks like you after a specialised csv processing method that's probably going to need a custom function node writing to do what your after

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 November 2019 15:31 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/9 "2019-11-04T15:31:15Z")

</div>

Indeed, it sounds more like the OP is trying to process a text input into columns. That isn't really what the CSV node is for. It would likely be better done using a file-in node and a function node to process the data.

---

<div class="post-metadata">

**Author:** ![rueben](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@rueben](https://discourse.nodered.org/u/rueben)\
**Post date:** [7 November 2019 03:25 UTC](https://discourse.nodered.org/t/changing-column-separator-dynamically-for-csv-node/17472/10 "2019-11-07T03:25:28Z")

</div>

> [@cymplecy](#):
>
> node writing to do what yo

Thank you everyone for the feedback.
