Forums

Running a csv file

Hi Guys -

I am trying to call a csv file in my script. I have both the script and the csv in a directory. I keep getting no such file error.

Here is my code:

with open('64502_clean.csv', newline='') as f:
    reader = csv.reader(f)
    for row in reader:
        number = ''.join(row)
        ex_number = number[:6]
        #print(ex_number)
        if ex_number not in token:
            token.append(ex_number)

I have also tried call the file with an absolute address

 /home/nextlevelmarketing/tax_scrap/64502_clea,.csv

That didn't work either. Any help would be appreciated.

Thansk, ES

Where you say "clea,.csv", did you mean "clean.csv"? Could it be as simple as a typo?