Jump to content

10 posts in this topic

Posted

I have a folder that contains 50 text files ,i require a program that can read these text files and convert them into tables,i want the primary key to be the name of the text file.
//sample contents of my 1.txt file is as follows
atro
astrology
king
moon
monkey
seven
skin
All the text file contain the information in the same format

Share this post


Link to post
Share on other sites

Posted

[quote name='ramesh0123' timestamp='1361787972' post='595542094']
I have a folder that contains 50 text files ,i require a program that can read these text files and convert them into tables,i want the primary key to be the name of the text file.
<snip>
All the text file contain the information in the same format
[/quote]
So you want 50 files converting into 50 tables, with a primary key bein the name of the file? eh? *headsplodes*
1 person likes this

Share this post


Link to post
Share on other sites

Posted

red rum... Red Rum... RED RUM... RED RUM! RED RUM! RED RUM! RED RUM!

Share this post


Link to post
Share on other sites

Posted

yeah i am lost too

If you had one table with the text files name as the primary key

but if you had a table for each text file the primary key could not be the name of the text file as the primary key has to be unique

Share this post


Link to post
Share on other sites

Posted

Using a VARCHAR as a primary key would be a bad idea.

Share this post


Link to post
Share on other sites

Posted

I call TROLL!

Share this post


Link to post
Share on other sites

Posted

So you require someone to do your homework? Good luck with that.

Share this post


Link to post
Share on other sites

Posted

Create the table + bash = 10 minutes top but why would you do this?

Share this post


Link to post
Share on other sites

Posted

[quote name='Dr_Asik' timestamp='1361901074' post='595545304']
So you require someone to do your homework? Good luck with that.
[/quote]

I wouldn't believe a teacher would assign such a weird assignment like this.

Share this post


Link to post
Share on other sites

Posted

The primary key has to be UNIQUE as it is what is used to reference a record in a table.

So if your file (1.txt) contained:

atro
astrology
king
moon
monkey
seven
skin

Then your table would not be able to use the file name as the primary key for each of those records because the file name doesn't change; it will always be 1.txt. Each of those seven records must have a unique primary key.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.