Results 1 to 4 of 4

Thread: How to add a list of categories from txt file

  1. #1
    Join Date
    Aug 2007
    Posts
    63

    Default How to add a list of categories from txt file

    Hi,
    I have a main category named
    Grape Varieties

    I want to add a chunk of a few hundred varieties to this category and
    have a list in a notpad .txt file such as

    Almeria
    Alwood
    Bianco
    Cabernet
    et....

    Is there an easier way than to add each of them one at a time thru the admin?

    Any help would be grapely appreciated.
    Michel
    As soon as everything's idiot-proof, God creates better idiots...
    Michel White
    http://www.vitisearch.com

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Yup, and I'll tell you how since i'm such a nice guy

    And by the way, you haven't commented on my Grape pictures yet.

    If you're only doing categories then you need to make yourself a text file. Name it whatever you want.

    All you need in this text file to make it work is 4 things for each category

    category_id parent_id name description

    Category_id is the category_id of your new category. This should start at ONE number higher than the highest category you currently have

    parent_id should be 0 if you are making a MAIN category. Otherwise the parent_id will be the category_id that the link belongs to

    name is quite obvious, this is the name of your category

    description is quite obvious as well, it is the description of the category.

    Put all that together and you've got yourself a category database!

    But you need to do it in a certain way, which I'll tell you if you give me $20 (or just read a little further).

    category_id parent_id name description
    1 0 Category 1 Description 1
    2 0 Category 2 Description 2
    3 0 Category 3 Description 3
    4 0 Category 4 Description 4
    5 0 Category 5 Description 5


    Each row is seperated by a TAB character. If it's not then it will NOT work properly!

    Of course the above is missing some info such as category permissions, cat pricing, meta keywords and descriptions but that's the basic info. I've attached a sample with ALL fields so you can take a better look. Don't forget to turn word wrap OFF to view this properly. Of course you can also import it into Excel so you can work with the info easier. Once you're done export as text - tab delimited.

    Enjoy!
    Attached Files Attached Files

  3. #3
    Join Date
    Aug 2007
    Posts
    63

    Default

    What grape pictures?.....

    I think I get the picture of how this is done but I'm way too afraid of messing up my grapey database. I'd have to see for example, the text file with one category addition filled in (exactly) the way the file needs to look when I export it. I guess I can do it by hand.....only a few hours or a day probably....

    I don't know with your example if I'm supposed to export it with the descriptions listed at the top of the txt file, for example...

    Thanks again, though and tell me what you mean about the grape pics...

    Do I need to go over there this winter and set up a vineyard for you?
    M

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    I sent you a PM with some links to pictures of my grapes. They are large pics so they'll take a while to load.

    http://www.avtronics.net/Grapes2.jpg
    http://www.avtronics.net/Grapes5.jpg

    The descriptions at the top of the file must be deleted, those are there as an example only. Also delete the first blank line.

    I've attached a sample category import file with 10 lines and it is set up exactly how it needs to be for when you import into your directory.

    Don't forget to change the category numbers as mentioned above!
    Attached Files Attached Files

Similar Threads

  1. About googlepr.php file
    By Mickey in forum v5.x
    Replies: 5
    Last Post: 06-24-2007, 02:59 PM
  2. mod for an XML file
    By alfo in forum Blocks and Modification
    Replies: 16
    Last Post: 11-27-2006, 04:59 AM
  3. How to include a [php] or [html] file in a [.tpl] file
    By althahabi in forum Website development, hosting and promotion
    Replies: 3
    Last Post: 07-04-2006, 11:21 PM
  4. How to call .php file
    By tane in forum v5.x
    Replies: 3
    Last Post: 03-11-2006, 02:40 AM
  5. sql tables as txt file
    By Hetti in forum Indexu Lite
    Replies: 0
    Last Post: 06-03-2005, 02:03 AM

Posting Permissions

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