Python CSV Module - Can't hold text format
Question: EDIT* Solution was to wrap text in the column. This will restore the original
format.

I am trying to create a CSV using the CSV module provided in Python. My issue
is when the CSV is created the contents of the file inserted into the field
loses it's format.

Example input can be pulled from 'whois 8.8.8.8'. I want the field to hold the
formatting from that input.

Is there a way to maintain the files original format within the cell?

    
    
    #!/usr/bin/python
    
    import sys
    import csv
    
    file1 = sys.argv[1]
    file2 = sys.argv[2]
    
    myfile1 = open(file1, "rb")
    myfile2 = open(file2, "rb")
    ofile  = open('information.csv', "wb")
    
    stuffwriter = csv.writer(ofile, delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL)
    
    stuffwriter.writerow([myfile1.read(),myfile2.read()])
    
    myfile1.close()
    myfile2.close()
    ofile.close()
    

Example Input(All In One Cell):

    
    
    #
    # ARIN WHOIS data and services are subject to the Terms of Use
    # available at: https://www.arin.net/whois_tou.html
    #
    
    
    #
    # Query terms are ambiguous.  The query is assumed to be:
    #     "n 8.8.8.8"
    #
    # Use "?" to get help.
    #
    
    #
    # The following results may also be obtained via:
    # http://whois.arin.net/rest/nets;q=8.8.8.8?showDetails=true&showARIN=false&ext=netref2
    #
    
    Level 3 Communications, Inc. LVLT-ORG-8-8 (NET-8-0-0-0-1) 8.0.0.0 - 8.255.255.255
    Google Incorporated LVLT-GOOGL-1-8-8-8 (NET-8-8-8-0-1) 8.8.8.0 - 8.8.8.255
    
    
    
    #
    # ARIN WHOIS data and services are subject to the Terms of Use
    # available at: https://www.arin.net/whois_tou.html
    #
    

Would like the cell to hold the format above. Currently when I open in Excel
it is all one line.

I am getting my data from executing:

    
    
    whois 8.8.8.8 > inputData.txt
    echo "8.8.8.8 - Google" > inputData2.txt
    python CreateCSV inputData2.txt inputData.txt
    

This is what I would like to see:
<http://www.2shared.com/photo/WZwDC7w2/Screen_Shot_2013-06-06_at_1231.html>

This is what I'm seeing:
<http://www.2shared.com/photo/9dRFGCxh/Screen_Shot_2013-06-06_at_1222.html>


Answer:   1. Convert .CSV to an .XLSX 
  2. In Excel, right click column with data that lost it's format
  3. Select 'Format Cells...'
  4. Select the 'Alignment' tab
  5. Check 'Wrap Text'
  6. All is good!

