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:
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
prints out:
('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-lis
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 need
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
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. T
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 en
ECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Diez 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
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
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
[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
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
crea
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 cre
13 matches
Mail list logo