On Apr 1, 12:22 am, afandi [EMAIL PROTECTED] wrote:
On Mar 30, 4:46 am, Gerhard Häring [EMAIL PROTECTED] wrote:
Gabriel Genellina wrote:
[...]
and execute:
cur.executemany(insert into log (IP, EntryDate, Requestt, ErrorCode)
values (:ip, :date, :request, :errorcode), values)
Thanks regards to your suggestion, but I don't understand why we have
to put the IF statement?
It's just an example, one possible implementation could be:
def parse_data(data):
mapping = {}
for line in data.splitlines():
if not line.strip():
continue
key,
On Mar 30, 4:46 am, Gerhard Häring [EMAIL PROTECTED] wrote:
Gabriel Genellina wrote:
[...]
and execute:
cur.executemany(insert into log (IP, EntryDate, Requestt, ErrorCode)
values (:ip, :date, :request, :errorcode), values)
It's probably worth mentioning that pysqlite's executemany()
En Mon, 31 Mar 2008 11:22:40 -0300, afandi [EMAIL PROTECTED]
escribió:
On Mar 30, 4:46 am, Gerhard Häring [EMAIL PROTECTED] wrote:
The deluxe version with generators could look like this:
def parse_logfile():
logf = open(...)
for line in logf:
if ...:
row =
Gabriel Genellina wrote:
[...]
and execute:
cur.executemany(insert into log (IP, EntryDate, Requestt, ErrorCode)
values (:ip, :date, :request, :errorcode), values)
It's probably worth mentioning that pysqlite's executemany() accepts
anything iterable for its parameter. So you don't need to
Hi,
Generally, it involves SQL statement such as
follow
INSERT INTO tablename(field1,field2,...fieldn) VALUES
('abc','def'...)
If I have data taken from Apache Server Log,let say 100 lines which
is printed output of 8 fields such
as:
data 1
IP: 61.5.65.101
Date: 26/Sep/2007
En Fri, 28 Mar 2008 18:05:29 -0300, afandi [EMAIL PROTECTED]
escribió:
Generally, it involves SQL statement such as
follow
INSERT INTO tablename(field1,field2,...fieldn) VALUES
('abc','def'...)
If I have data taken from Apache Server Log,let say 100 lines which
is