SHARE
TWEET

Untitled

a guest Jun 7th, 2017 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Code to be executed:
  2. import csv
  3. import os
  4.  
  5. directory = '/home/misterwhite/Documents/pagecounts/'
  6. delim = ' '
  7.  
  8. for file in os.listdir(directory):
  9.     with open(directory+file, 'r') as f:
  10.         reader = csv.reader(f, delimiter = delim)
  11.         start = reader.__next__()
  12.         max_length = [len(i) for i in start]
  13.         for row in reader:
  14.             for i in range(len(row)):
  15.                 max_length[i] = max(len(row[i]),max_length[i])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top