title: How to sort numbers from text file after splitting
body: <p>Could someone please help me with sorting numbers from a text file once split. I have the following text file which i need to sort the numbers from low to high. No matter the sequence or number values I need to sort them from low to high.</p>
  <p>So far I have the following code but its still not sorting the numbers. Any help would really be great. Thank you.</p>
  <p>Text file (input.txt):</p>
  <blockquote>
  <p>﻿min:2,1,4,3,6,5</p>
  <p>max:1,2,3,4,5,6</p>
  <p>avg:1,2,3,4,5,6</p>
  </blockquote>
  <p>My code so far:</p>
  <pre><code>inputFile = open(&quot;input.txt&quot;, 'r')
  lineList = inputFile.readlines()
  print (lineList)
  for line in lineList:
      numbers = [int(item) for item in line.split(':')[1].split(',')]
      numbers.sort()
      with open('inputcopy.txt', 'a') as f:
          for line in lineList:
              numbers.sort()
              f.write(line)     
  </code></pre>