On Aug 15, 7:12 am, John Machin [EMAIL PROTECTED] wrote:
On Aug 15, 4:55 am, [EMAIL PROTECTED] wrote:
#your thought is right.
===
def sizes2fields(sizes):
d = []
begin = 0
for i in sizes:
if begin:
end =
Stacey wrote:
Hi Guys,
I'm new to Python (mostly) and I'm wanting to use it for a new project
I'm faced with.
I have a machine (PLC) that is dumping its test results into a
fixed-length text file. I need to pull this data into a database
(MySQL most likely) so that I can access it with
B. Roggisch
Sent: Thursday, August 14, 2008 7:11 AM
To: python-list@python.org
Subject: Re: Fixed-length text file to database script
Stacey wrote:
Hi Guys,
I'm new to Python (mostly) and I'm wanting to use it for a new project
I'm faced with.
I have a machine (PLC) that is dumping its
Michael Ströder wrote:
Larry Bates wrote:
[EMAIL PROTECTED] wrote:
I have a machine (PLC) that is dumping its test results into a fixed-
length text file. I need to pull this data into a database (MySQL
most likely) so that I can access it with Crystal Reports to create
daily reports for my
I have a machine (PLC) that is dumping its test results into a fixed-
length text file.
While it has nothing to do with python, I found that creating a MySQL
table with the proper fixed length char() fields and using 'load data
infile' was the easiest way to deal with that sort of scenario.
Sorry, didn't get to finish my script. Have to figure out the deal
with gmail and the tab key someday.
myfile = '/somewhere/somefile.txt'
sizes = [16,4,8,8,8]
fd = open(myfile,r)
data = []
for line in fd.readlines() :
a = []
idx1 = 0
for l in sizes :
idx2 = idx1 + l
Larry Bates wrote:
While you are correct, that is not what the OP asked. There is no
reference to processing data prior to insertion into MySQL database.
Also the OP said they had a 1 day deadline.
Larry, having a bad day?
I'm confident that the OP is able to sort out *himself* what he
:
('1234567890123456', '7890', '12345678', '90123456', '78901234')
hope it helps.
thanks Edwin
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Eric Wertman
Sent: Thursday, August 14, 2008 1:59 PM
To: python-list@python.org
Subject: Re: Fixed-length text file to database
On Aug 15, 4:55 am, [EMAIL PROTECTED] wrote:
#your thought is right.
===
def sizes2fields(sizes):
d = []
begin = 0
for i in sizes:
if begin:
end = begin + i
else: end = i
d.append((begin, end))
Hi Guys,
I'm new to Python (mostly) and I'm wanting to use it for a new project
I'm faced with.
I have a machine (PLC) that is dumping its test results into a fixed-
length text file. I need to pull this data into a database (MySQL
most likely) so that I can access it with Crystal Reports to
Hi Guys,
I'm new to Python (mostly) and I'm wanting to use it for a new project
I'm faced with.
I have a machine (PLC) that is dumping its test results into a
fixed-length text file. I need to pull this data into a database
(MySQL most likely) so that I can access it with Crystal Reports to
[EMAIL PROTECTED] wrote:
Hi Guys,
I'm new to Python (mostly) and I'm wanting to use it for a new project
I'm faced with.
I have a machine (PLC) that is dumping its test results into a fixed-
length text file. I need to pull this data into a database (MySQL
most likely) so that I can access it
Larry Bates wrote:
[EMAIL PROTECTED] wrote:
I have a machine (PLC) that is dumping its test results into a fixed-
length text file. I need to pull this data into a database (MySQL
most likely) so that I can access it with Crystal Reports to create
daily reports for my engineers.
[..]
I need to
13 matches
Mail list logo