title: Renaming files will not work with >1 GB file
body: <p>I'm using the below code to rename few hundreds of files, it works great when the file is smaller than 1GB in size, but when it encounter larger files it doesn't extract anything and the resulted file name is blank.</p>
  
  <pre><code>import os, linecache
  
  for filename in os.listdir(path):
      if not filename.startswith("out"): continue # less deep
      file_path = os.path.join(path, filename) # folderpath + filename
      fourteenline = linecache.getline(file_path, 14) # maybe 13 for 0-based index?
      new_file_name = fourteenline[40:40+50].rstrip() # staring at 40 with length of 50
      os.rename(file_path, os.path.join(path, new_file_name))
  </code></pre>