I have the following code:
import os
import csv
listing = os.listdir('/directory/my/files/are/in')
os.chdir('/directory/my/files/are/in')
for file in listing[1:]:
r = csv.reader(open(file, 'rU'))
for row in r:
stuff = [str.split('\t', 1) for row in r]
print stuff
which returns TypeError: expected a character buffer object. How do I fix this? Basically I want to open all (csv) files in a directory and then cut out certain junk from each cell (everything after and including /t.)
listing[0]? - Karl Knechtel