General Perl / Mysql question

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
jmackenz
Forum Regular
Forum Regular
Posts: 116
Joined: Tue Jan 23, 2007 10:18 am

General Perl / Mysql question

Unread post by jmackenz »

Hello,

I have a file that has each field separated by | and each line is new record

There are six fields

property|type|details|date1|date2|frequency

I would like to do the following :

Create a table name for each name in field 1 , there are many instances of the same name , so probably need to look for dupes first

This new table should have the fields type details date1 date2 frequency

I would secondly like to enter the records from the file into these newly created tables.

At the end of the day this will be a calendar database with tables for each property (approx 30 of them)

it seems like it should be a pretty simple task using perl, assuming I knew where to begin...

any pointers would be appreciated... to google I go :)
spaceout
Forum Regular
Forum Regular
Posts: 112
Joined: Wed Mar 19, 2008 10:22 pm

Unread post by spaceout »

Using Perl or PHP would work fine. As far as entering in the data you could probably look into using phpMyAdmin. It's included in most hosting control panels.

I'm not sure I understand how you're wanting to set up your database tables. I don't think you would want a different table for each property. If I understand correctly, you would want one table for the properties and another table for the other information.

The table for the properties would need at least two fields. Something like:

property_id
property_name

Your other table would have something like:

record_id
property_id
type
details
date1
date2
frequency

I may be wrong through. As I said, I'm not completely clear on what you're trying to accomplish.

Take a look at http://en.wikipedia.org/wiki/Database_normalization
Post Reply