join(row)
On Wed, Jul 29, 2009 at 8:13 AM, Wayne wrote:
> On Tue, Jul 28, 2009 at 9:36 PM, Nick Burgess
> wrote:
>>
>> Good evening List,
>>
>> I am trying to have this script search for an IP or nearest subnet
>> match in a dir of csv's. It works
Good evening List,
I am trying to have this script search for an IP or nearest subnet
match in a dir of csv's. It works with an absolute match, It will be
receiving a whole IP address, so if there is no absolute match no data
is returned, however if it is listed somewhere in a subnet I want to
kn
Thanks everyone, the following code works great. It returns the name
of the file and the row that matched the reqex. Is it posible to take
the regex compile from user input? To make it take an argument, like
> csvSearch.py 10.192.55
af = re.compile(sys.argv[1])
pattern = re.compile(af)
or cell in row:
if pattern.search(cell):
print ', '.join(row)
XLS.xls.org1.csv
XLS.xls.org2.csv
XLS.xls.org3.csv
On Sat, Jun 6, 2009 at 3:33 PM, Emile van Sebille wrote:
> On 6/6/2009 12:19 PM Nick Burgess said...
>>
>> Thank you. The data is
TypeError: coercing to Unicode: need string or buffer, list found
On Sun, May 31, 2009 at 12:45 PM, Richard
Lovely wrote:
> 2009/5/31 Nick Burgess :
>> Got it.
>>
>> the row is not a string or buffer but the cell is..
>>
>> for row in spamReader:
>> for ce
Got it.
the row is not a string or buffer but the cell is..
for row in spamReader:
for cell in row:
if pattern.search(cell):
print ', '.join(row)
On Sun, May 31, 2009 at 5:09 AM, Nick Burgess wrote:
> Thank you for your response and my apologies for t
9 it returns all of the rows, so I now its reading OK..
Thanks for your time,
-nick
On Sun, May 31, 2009 at 3:57 AM, Alan Gauld wrote:
>
> "Nick Burgess" wrote
>>
>> I am trying to make this code work. I don't have any experience with
>> defining things
Hi list,
I am trying to make this code work. I don't have any experience with
defining things and this is my second program. The error returmed is
"SyntaxError: invalid syntax"
code:
#!/usr/bin/python
import cvs
def convertXLS2CSV(aFile):
'''converts a MS Excel file to csv w/ the same n
forgot to add this at the top,
allfiles = []
On Tue, May 5, 2009 at 6:15 PM, Nick Burgess wrote:
> for root, dirs, files in os.walk('./'):
> for f in files:
> if f.endswith('.txt'):
> allfiles.append(os.path.join(root, f))
>
> This
for root, dirs, files in os.walk('./'):
for f in files:
if f.endswith('.txt'):
allfiles.append(os.path.join(root, f))
This returns a list of the *.txt files. Of course now I am stuck on
how to apply the delimiter and search function to the items in the
list..? Any clues/ex
Compiling the regular expression works great, I cant find the tutorial
Mr. Gauld is referring to!! I searched python.org and alan-g.me.uk.
Does anyone have a link?
On Mon, May 4, 2009 at 1:46 PM, Martin Walsh wrote:
> Nick Burgess wrote:
>> So far the script works fine, it avoids pri
So far the script works fine, it avoids printing the lines i want and
I can add new domain names as needed. It looks like this:
#!/usr/bin/python
import re
outFile = open('outFile.dat', 'w')
log = file("log.dat", 'r').read().split('Source') # Set the line delimiter
for line in log:
if not re.
How do I make this code print lines NOT containing the string 'Domains'?
import re
for line in log:
if re.search (r'Domains:', line):
print line
This does not work...
if re.search != (r'Domains:', line):
___
Tutor maillist - Tutor@pytho
13 matches
Mail list logo