# Multiple Line Output to .txt and .inp

**URL:** <https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468>\
**Category:** General Usage\
**Created:** [March 28, 2019, 4:02pm UTC](https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468 "2019-03-28T16:02:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulrich](https://avatars.discourse-cdn.com/v4/letter/u/dbc845/32.png) [@Ulrich](https://discourse.julialang.org/u/Ulrich)\
**Post date:** [March 28, 2019, 4:02pm UTC](https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468/1 "2019-03-28T16:02:50Z")

</div>

Hello,

I just started using Julia and I cant seem to figure out how to write to .txt or .inp properly. I need to create a list with different compounds on different lines on .txt. I tried working with the normal text file handling and with delimitedfiles.  
The export always look like this\>

Compound1 Compound2 Compound3

and I need it to look like this:

Compound1  
Compound2  
Compound3

Using \n does not seem to work, I might be writing the Syntax wrong.

The output works fine when I write it to a .csv but I need it on a .txt file to run CosmoTherm (Software for predictive chemistry).

Thanks a lot.  
Best regards,  
Ulrich

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [March 28, 2019, 4:18pm UTC](https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468/2 "2019-03-28T16:18:36Z")

</div>

Hi Ulrich,

Can you post a short snippet of your code that demonstrates the problem?

Also how are you verifying your text file? One possibility is that your textfile has unix-style newlines but they’re not being displayed, for instance if you open in windows notepad.

---

<div class="post-metadata">

**Author:** ![Ulrich](https://avatars.discourse-cdn.com/v4/letter/u/dbc845/32.png) [@Ulrich](https://discourse.julialang.org/u/Ulrich)\
**Post date:** [March 29, 2019, 12:12pm UTC](https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468/3 "2019-03-29T12:12:55Z")

</div>

Hi,

It is working now. I didnt`t know the file would keep the newlines even though it wasnt showing when I opened the notepad. My bad. I just ran the cosmotherm application and it created the proper input from the txt file I created with Julia.

Thanks 🙂

Best regards.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [March 29, 2019, 1:44pm UTC](https://discourse.julialang.org/t/multiple-line-output-to-txt-and-inp/22468/4 "2019-03-29T13:44:48Z")

</div>

Julia uses `\n` (newline) as line terminators as is standard on all platforms besides Windows. Some old Windows applications—in particular Notepad—do not understand this as a line terminator and only understand `\r` (carriage return) as line terminators. These applications consider `\n` to be “some whitespace character” and probably render it as a space. I would recommend using a better text editor that understands newlines.
