SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Addict SwordsmanX's Avatar
    Join Date
    Sep 2005
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I enter mass data from a txt into organized tables?

    Let's say I have a file with a play by shakespeare, divided into chapters
    How should I proceed about automatically adding every chapter in its own cell, under the play name, under the author name?
    Is there any specific software (or class of software) able to do this?

  2. #2
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tough cookie.

    This is not a database question, it really is a total solution. Guess you have to purchase one

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    most likely, you're going to have to write someting yourself. this should take about 15 minutes in PHP or ASP or any other scripting language.

  4. #4
    Geek of all trades ... GORF's Avatar
    Join Date
    Oct 2004
    Location
    New England
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by longneck
    most likely, you're going to have to write someting yourself. this should take about 15 minutes in PHP or ASP or any other scripting language.
    ... By "tagging" the beginning of each chapter to be recognized by your homemade script. Manually inserting some character(s) at the start of each. Let's say ~BOC~. Have the script look for that.

    But if you have to go that far, you might as well tag the end of each chapter also.

    If yo tag both the beginning and end, you might as well use <td> and </td>.

    Sorry it doesn't seem like much help.


    Now that I re-read the post, it looks like you need to use XML.
    Tag all 3 elements:

    <Author>
    XXX
    </Author>
    <Play>
    XXX
    </Play>
    <Chapter>
    XXX
    </Chapter>
    <Chapter>
    XXX
    </Chapter>
    <Chapter>
    XXX
    </Chapter>

    <EOF>
    http://www.tonsofwebsites.com Hosting Tons of Websites for years
    http://www.cpanelbuys.com Buying cPanel hosting companies
    http://www.namesvibe.com Cheap domains - Good vibes!

  5. #5
    Not yet perfect mattalexx's Avatar
    Join Date
    Oct 2005
    Location
    Taos, NM, US
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A way to do that would be to find some identifier that would differenciate your data (play name, author, chapter #, chapter text). Those xml-like tags that GORF mentioned would work-- you could add them. Then you have two choices: 1. open up Dreamweaver or some other text editor that has a strong replace function and make it into an INSERT SQL statement. Pop it into your database... or 2. Write a PHP script that will open the file, read it, convert it into SQL and run the SQL server-side.

  6. #6
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mattalexx
    1. open up Dreamweaver or some other text editor that has a strong replace function and make it into an INSERT SQL statement. Pop it into your database...
    ooo... that makes my hooves tingle...

    (giraffes have hooves, right?)

  7. #7
    SitePoint Addict SwordsmanX's Avatar
    Join Date
    Sep 2005
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LOL @ longneck
    thank you guys for your help: you've given me a couple of good ideas


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •