# object array to file

**URL:** <https://discourse.nodered.org/t/object-array-to-file/44332>\
**Category:** General\
**Created:** [17 April 2021 20:58 UTC](https://discourse.nodered.org/t/object-array-to-file/44332 "2021-04-17T20:58:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [17 April 2021 20:58 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/1 "2021-04-17T20:58:46Z")

</div>

Hello! I have multiple objects in an array.

I would like to save this in the txt file.

Unfortunately we haven't found a solution yet. Maybe someone can help me there.

This is what the array looks like

[0… 9]  
0: object  
col1: "ASC91880"  
1: object  
col1: "ASC91881"  
2: object  
col1: "ASC91882"  
3: object  
col1: "ASC91883"  
4: object  
col1: "ASC91884"  
5: object  
col1: "ASC91885"

I want to export it like this

ASC91880  
ASC91881  
ASC91882  
ASC91883  
ASC91884  
ASC91885

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 April 2021 21:08 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/2 "2021-04-17T21:08:04Z")

</div>

I am pretty sure if you pass this array through a CSV node then to the file node, that's exactly what you'll get.

Ps, when copying from the debug, use the copy button that appears under your mouse pointer when you hover over the msg payload. (and use the forums code toolbar button to preserve formatting - makes things much easier to read)

---

<div class="post-metadata">

**Author:** ![madmax](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@madmax](https://discourse.nodered.org/u/madmax)\
**Post date:** [18 April 2021 08:13 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/3 "2021-04-18T08:13:49Z")

</div>

Hello!

Many thanks for the answer.

I want to steal the values in one another.

just like here

ASC91880  
ASC91881  
ASC91882  
ASC91883  
ASC91884  
ASC91885

 ![Bildschirmfoto 2021-04-18 um 10.09.19](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/17a571b7caf454bf2ca5425ac13b968f62a7a5ab.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 April 2021 08:56 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/4 "2021-04-18T08:56:17Z")

</div>

> [@madmax](#):
>
> I want to steal the values in one another

Not certain what you mean.

Did you try the CSV node?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [18 April 2021 08:58 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/5 "2021-04-18T08:58:05Z")

</div>

I believe he wants it sorted in order  
e.g.

```auto
[{"id":"144d3c45.d26de4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"col1\":\"ASC91880\"},{\"col1\":\"ASC91882\"},{\"col1\":\"ASC91883\"},{\"col1\":\"ASC91881\"}]","payloadType":"json","x":100,"y":960,"wires":[["f371ac23.cad37"]]},{"id":"f371ac23.cad37","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload^(col1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":960,"wires":[["f8ca8b1e.bbec98"]]},{"id":"f8ca8b1e.bbec98","type":"csv","z":"5a245aa1.510164","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":490,"y":960,"wires":[["62541fd9.d58bc8"]]},{"id":"62541fd9.d58bc8","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":680,"y":960,"wires":[]}]

```

---

<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 June 2021 08:58 UTC](https://discourse.nodered.org/t/object-array-to-file/44332/6 "2021-06-17T08:58:44Z")

</div>

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