Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > looking for data on csv files

Reply
Thread Tools

looking for data on csv files

 
 
flit
Guest
Posts: n/a
 
      08-28-2006
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..

 
Reply With Quote
 
 
 
 
faulkner
Guest
Posts: n/a
 
      08-28-2006
import re
if re.search(nome, row[rowcsv], re.I):
...

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

flit wrote:
> 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..


 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      08-28-2006
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.
>>> if nome in row[rowcsv]:

.... 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to parse a csv...... a csv that has CRLF in the fields sso Java 20 04-26-2009 11:04 AM
read and write csv file using csv module jliu66 Python 0 10-19-2007 03:12 PM
How to move data from a CSV file to a JTable, and from a JTable to a CSV file ? Tintin92 Java 1 02-14-2007 06:51 PM
Re: csv writerow creates double spaced excel csv files Skip Montanaro Python 0 02-13-2004 08:50 PM
csv writerow creates double spaced excel csv files Michal Mikolajczyk Python 0 02-13-2004 08:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57