Keep newlines after split
<p>I have the following code, it splits my file that has 4 columns to separate
files. the last column "loses" his new lines.
How can I keep them?</p>

<pre><code>for line in routeFile:
    if line.__contains__("internal"):
        # split the line into a list of columns values
        fields = line.split()
        if len(fields) &gt;= 2:
            print(fields[1], file=file_hosts)   # Prints the 2nd column - the hosts
        if len(fields) &gt;= 3:
            print(fields[2], file=file_domain)  # Prints the 3rd column - the domain
        if len(fields) &gt;= 4:
            print(fields[3], file=file_apps)    # Prints the 4th column - the apps
</code></pre>

<p>EDIT:
This is my file, I need the apps column to stay exactly as it is (With the newlines between the apps)</p>

<pre><code>&gt; space       host                 domain              apps    
&gt; abc    cloudconfiguration   cfdev.internal                
&gt; abc    globalbootstrap      cfdev.internal    globalbootstrap          
&gt; abc    tenant-management    cfdev.internal
&gt; abc    uaa-management       cfdev.internal 
&gt; abc    tenant               cfdev.internal    tenant               
</code></pre>