Re: Need help converting text to csv format

2008-11-22 Thread Chuck Connors
Firstly, I would like to thank those that offered help.  I was able to
get my data into the database and also have connectivity with the
mysql and can pull the data in/out at will.  Hooray and thanks again.

Secondly,  perhaps I overstated my abilities.  I have written a couple
of websites from scratch that pull data in/out of databases and have
formatted their outputs for user consumption.  I am by no means a php
expert and have never had occasion to use regular expressions for the
type of data I've been manipulating.  My sarcastic reply was only in
response to the 'go google it' answer I received to what I thought was
a fair question.  It's usually easiest to google something if you know
what you are looking for.  At no point did I expect anyone to spend a
great deal of time working out my specific problem but I am most
grateful for those who did provide more than what could have been
expected.

--
http://mail.python.org/mailman/listinfo/python-list


Need help converting text to csv format

2008-11-21 Thread Chuck Connors
Hey guys.  I'm working on a little program to help my wife catalog her/
our coupons.  I found a good resource but need help formatting the
text data so that I can import it into a mysql database. Here's the
data format:

40922003 Life Fitness Products $1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to $3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)

The first value (large number) is the UPC, the next element is the
coupon description, followed by a date in parenthesis.  Those are the
only three elements I am concerned with.  Can someone help me in
reformatting this:

40922003 Life Fitness Products $1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to $3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)

into something like this:

"40922003","Life Fitness Products $1","12-13-08"
"546500181141","Oust Air Sanitizer, any B1G1F up to $3.49","1-17-09"
"518000159258","Pillsbury Crescent Dinner Rolls, any .25","2-14-09"
"518000550406","Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40","2-14-09"

Any help, pseudo code, or whatever push in the right direction would
be most appreciated.  I am a novice Python programmer but I do have a
good bit of PHP programming experience.

Thanks for your time
--
http://mail.python.org/mailman/listinfo/python-list


Re: Need help converting text to csv format

2008-11-21 Thread Chuck Connors

> I'm wondering if PHP experience precludes the ability to use a search
> engine before asking for help...

Thanks for the push in the right direction, friend.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Need help converting text to csv format

2008-11-21 Thread Chuck Connors
Wow!  What a change in direction from the previous post.  Thank you
both for the help and the explanations.  This will work great!
--
http://mail.python.org/mailman/listinfo/python-list


Reading then sending new parts of a log file

2009-06-24 Thread Chuck Connors
Hey guys.  I'm trying to work up a little program that will send any
new lines written to a file (log file from my home automation
software) to me via instant message.  I've gotten the instant message
sending part figured out using xmpppy.

I've done a few things with Python in the past but I am in no means
more than a beginner/hacker.  Can someone tell me what commands/
modules/etc exist for monitoring and parsing a file for new
information that I can then send to my IM sending function?  I am not
asking for anyone to write the code but merely a push in the right
direction.

Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading then sending new parts of a log file

2009-06-24 Thread Chuck Connors
On Jun 24, 11:57 am, Scott David Daniels 
wrote:
> What OS and version, what Python and version.

Win XP, Python 2.6.2
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reading then sending new parts of a log file

2009-06-24 Thread Chuck Connors
On Jun 24, 2:48 pm, unayok  wrote:
> Here's a little nudge:http://code.activestate.com/recipes/157035/
>
> In place of its "print" line, you'd make your call into your existing
> code to send the message.

Wow!  Thanks for the _shove_ in the right direction.  Looks perfect.
-- 
http://mail.python.org/mailman/listinfo/python-list