title: How to split two columns in a table in python
body: <p>There is table of data</p>
  
  <pre><code>1 2
  
  1 3
  
  33 34
  
  10 22
  
  11 23
  
  25 26
  
  27 28
  
  .....
  </code></pre>
  
  <p>now I need to split data in the two columns and merge them in to a single list The code I have written below does the job for single digit numbers but not for two or three digit numbers.</p>
  
  <pre><code>myfile = open("karate.txt","r") #read and write to a file 
  
  for line in myfile.read():   # read data in the file
      fields = ' '.join(line.split()) # split columns of table based on space   
      print fields
      rows = map(int,fields) # converting tuple to integer
      data.extend(rows)
  </code></pre>
  
  <p>The output of this code for the above data is</p>
  
  <pre><code>1
  
  
  2
  
  
  1
  
  
  3
  
  
  3
  
  3
  
  
  3
  
  4
  
  
  1
  </code></pre>
  
  <p>but I need the output as</p>
  
  <pre><code>1
  
  2
  
  1
  
  3
  
  33
  
  34
  
  11
  
  23
  
  25
  
  26
  
  27
  
  28
  </code></pre>