-1
I’m trying to read a CSV file and create a list of all the words in the file and how many times it appears. Originally the file was in PDF, but I thought it could be simpler to read in csv. I’m using Google Collab. I started looking for this information in Stack Overflow in EN and made a small adaptation for Google Colab, since I need to import the file.
import csv
from google.colab import files
from collections import Counter
from collections import defaultdict
words= []
arquivo = files.upload()
with open(str(arquivo), 'rt') as csvfile: #aqui eu coloquei a variável arquivo em str
reader = csv.reader(csvfile)
next(reader)
for col in reader:
csv_words = col[0].split(" ")
for i in csv_words:
words.append(i)
I’ve already received the "File name is Too long" error (OSERROR 36). I do not know how to continue from here. If anyone can guide me, I thank!
Good weekend for everyone.
can provide example file?
– Lucas
@Lucas, the link to the test file is https://drive.google.com/file/d/1tJ0Ri1exQwG15zce7orOIBVhlWRdtOI8/view?usp=sharing
– Raphael Pires