I have a Python code which counted occurrences of words on text (.txt) files:

```
find_words = re.compile(r'(?:(?<=[^\w./-])|(?<=^))[A-Za-z]+(?:-[A-Za-z]+)*(?=\W|$)').findall
wanted1 = set(find_words(open('word_list_1.csv').read().lower()))
wanted2 = set(find_words(open('word_list_2.csv').read().lower()))
negators = set(find_words(open('negators.csv').read().lower()))
ignore = set(find_words(open('Ignore words.csv').read().lower()))

```

then I would do the following to process the text files:

```
with open(csvfile, "wb") as output:
 writer = csv.writer(output)
 for f in glob.glob("*.txt"):
            print "Processing file number : ", i, " out of :", len(glob.glob("*.txt"))
            i=i+1
            with open(f) as inputfile:
                wordNumber=0
                for line in inputfile:
                 if find_words(line.lower()) != []:
                    lineWords=find_words(line.lower())

```

So, the question is, how do I do that for an excel file instead of .txt files? I tried to do the following:

```
for i in range(0, rows):
  for j in range(0,cols):
    write_sheet1.write(i,j,sheet.cell_value(i,j))
  if sheet.cell_value(i,4)!=0:
    for line in sheet.cell_value(i,4):
 print "Line is : ", line
 if find_words(line.lower()) != []:
    lineWords=find_words(line.lower())

```

but it is not working, it returns only one character, not the whole line and/or words...

So how can I make it work for excel cells instead of text files?