looking for data on csv files

F

flit

Hi!
I am using the csv modules..

when I use the command:

if nome in row[rowcsv]:
print "\n"
print row[rowcsv] + "\n ----> " + row[11] + "\n"
print
"################################################################"

there is this case:

1- data on file PUItarr

If the user try to find for puitarr or PUITARR it doesn´t find.

I tried the string.upper and .lower , but there is a a way to look far
all possible combinations?

And yes, i am a newbie..
 
F

faulkner

import re
if re.search(nome, row[rowcsv], re.I):
...

that's re.I [capital i] as in ignorecase.
 
B

Bruno Desthuilliers

flit a écrit :
Hi!
I am using the csv modules..

when I use the command:

if nome in row[rowcsv]:
print "\n"
print row[rowcsv] + "\n ----> " + row[11] + "\n"
print
"################################################################"

Python 2.4.1 (#1, Jul 23 2005, 00:37:37)
[GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on
linux2
Type "help", "copyright", "credits" or "license" for more information.
.... print "\n"
.... print row[rowcsv] + "\n ----> " + row[11] + "\n"
.... print
....
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'nome' is not defined

Not enough code to reproduce your problem. Please post the minimal
snippet reproducing your problem.
there is this case:

1- data on file PUItarr

If the user try to find for puitarr or PUITARR it doesn´t find.

I tried the string.upper and .lower , but there is a a way to look far
all possible combinations?
Probably.

And yes, i am a newbie..

Don't worry - we've all been newbies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top