# save serial data to .txt file on Mac

**URL:** https://discourse.processing.org/t/save-serial-data-to-txt-file-on-mac/12459
**Category:** Electronics (Arduino, etc.)
**Created:** [July 2, 2019, 7:51pm UTC](https://discourse.processing.org/t/save-serial-data-to-txt-file-on-mac/12459 "2019-07-02T19:51:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jasone](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@jasone](https://discourse.processing.org/u/jasone)
#### Post date: [July 2, 2019, 7:51pm UTC](https://discourse.processing.org/t/save-serial-data-to-txt-file-on-mac/12459/1 "2019-07-02T19:51:04Z")

</div>

I state that I don’t know how to use processing.  
I need to save data sent via serial from Arduino to a .txt file on my mac.  
Can anyone help me?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [July 3, 2019, 3:58am UTC](https://discourse.processing.org/t/save-serial-data-to-txt-file-on-mac/12459/2 "2019-07-03T03:58:25Z")

</div>

unless you expect that you get the full program here,  
it does actually not matter that you use arduino / serial / and a mac hardware…

if you have a string in a processing ( array ) variable you can save it to  
lines of a file using  
[https://processing.org/reference/saveStrings\_.html](https://processing.org/reference/saveStrings_.html)

* * *

pls note that best use like

```auto
String outfile = "data/fromArduino.txt";

void keyPressed() { // Press a key to save the data
  if ( key == 's' ) saveStrings(outfile, lines);
}

```
