[KLUG Members] Inserting data into MySQL]

Mike Slack members@kalamazoolinux.org
Wed, 7 Aug 2002 13:08:13 -0700


Why not just use Perl with DBI and skip PHP altogether?  Do you just
need to get this stuff in a (MySQL) database?  A good Perl coder could 
parse one of these files and insert into database table(s) in an hour
or so.

What do you mean by "format the text and precede it with ..."?  Do
you need to have some intermediate files of some sort?

Mike

randy perry (randallp@domain-logic.com) wrote:
> Yeah, I could post this to a SQL group, but I trust the noodledge in
> this group. (Besides, I don't belong to any SQL list).
> 
> We need to be able to parse text files similar to the following:
> 
> <text data>
> Judgment Spoiler List
> Wizards of the Coast, Inc.
> (Released May 21, 2002)
> 
> 143 Cards Total
> Color: 16 Black, 26 Blue, 33 Green, 27 Red, 33 White, 3 Land,
> 4 Multicolored
> 
> Rarity: 55 Common, 44 Uncommon, 44 Rare
> 
> Card Name:	Ancestor's Chosen
> Card Color:	W
> Mana Cost:	5WW
> Type & Class:	Creature - Cleric
> Pow/Tou:	4/4
> Card Text:	"First strike When Ancestor's Chosen comes into play, 
> 		you gain 1 life for each card in your graveyard."
> Flavor Text:	Empowered by generations of strength.
> Artist:		Pete Venters
> Rarity:		U
> Card #:		1/143
> 
> Card Name:	Aven Warcraft
> Card Color:	W
> Mana Cost:	2W
> Type & Class:	Instant
> Pow/Tou:	n/a
> Card Text:	Creatures you control get +0/+2 until end of turn. 
> 		Threshold - Creatures you control also gain protection 
> 		from the color of your choice until end of turn. (You 
> 		have threshold if seven or more cards are in your 
> 		graveyard.)
> Flavor Text:	n/a
> Artist:		Roger Raupp
> Rarity:		U
> Card #:		2/143
> </text data>
> 
> Ok, the tags aren't going to be there, just what is in between them.  I
> snipped it down to 2 to show you, but there are really hundreds.  There
> are also a lot of other lists that each have a hundred or so records.
> 
> I know that it won't port directly, so I am looking for any solution of perl, php, whatever. The solution should format the text and precede it with insert into cards values(....whatever).  (php on webpage
> PHP is preferred, but I could set that up as a front end to any solution.
> Ideas??? Anyone?? Anyone?
> 
> 
> Randall Perry
> 
> 
> _______________________________________________
> Members mailing list
> Members@kalamazoolinux.org
> 

-- 
Mike Slack
mike@slacking.org
--
"If we knew what it was we were doing, it wouldn't
be called research, would it?" --Albert Einstein