Hi,

is the data on it's own line? Card Name on one line and Cost and so  
on? if so you could

Is there a regular pattern? Maybe you could break on an empty line or  
something?

Sincerely,
Mike
-- 
Mike Brandonisio          *    Web Hosting
Tech One Illustration     *    Internet Marketing
tel (630) 759-9283        *    e-Commerce
[EMAIL PROTECTED]    *    www.jikometrix.net

     JIKOmetrix - Reliable web hosting



On Jan 28, 2008, at 8:05 PM, kevin myers wrote:

> no. each file contains anywhere from 98 to 434 cards.
>
> Mike Brandonisio <[EMAIL PROTECTED]> wrote: Hi,
>
> Do you have a text file for each card? If so you can read the
> directory to get a an array of files names. Then open the file read
> it into a var. Then explode or break each line into an array position
> on \n or \r. Then explode on semicolon. since you know line one is
> card name and line 2 is cost and so on you can then iterate through
> putting each item $_var[0][1] into another array moving the data to
> position 1. So $_var[0][1] would be copied to $_new-var[0][1] and
> then $_var[1][1] into $_new-var[0][2] and so on. once you build out
> the array you can create your insert by iterating the array.
>
> Does this make sense? The only catch is that each entry must be on
> it's own line. If not then this will not work.
>
> Sincerely,
> Mike
> -- 
> Mike Brandonisio          *    Web Hosting
> Tech One Illustration     *    Internet Marketing
> tel (630) 759-9283        *    e-Commerce
> [EMAIL PROTECTED]    *    www.jikometrix.net
>
>      JIKOmetrix - Reliable web hosting
>
>
>
> On Jan 27, 2008, at 1:09 PM, shaggy2dope2126 wrote:
>
>> i'm currently working on an online store. i am selling cards from the
>> magic the gathering game. there are 64 sets of these cards and its
>> taking me forever to make that sql files for database upload.  i was
>> wondering if there is someway to upload the text file and pull
>> sections of a line from the text file and create the sql files.
>>  the text file looks like this:
>>  Card Name: Auratouched Mage
>>        Cost: 5W
>>        Type: Creature — Human Wizard
>>     Pow/Tgh: 3/3
>>  Rules Text: When Auratouched Mage comes into play, search your
>>              library for an Aura card that could enchant it. If
>>              Auratouched Mage is still in play, attach that Aura
>>              to it. Otherwise, reveal the Aura card and put it into
>>              your hand. Then shuffle your library.
>>  Set/Rarity: Ravnica: City of Guilds uncommon
>>
>> im needing to get the card name, and rules text and insert them
>> into this:
>> INSERT INTO products VALUES (1, 0, 'single', 'card87952.jpg',
>> '0.0000', '2008-01-12 13:13:50', NULL, NULL, '0.00', 1,0,0,0);
>> INSERT INTO products_description VALUES (1, 1, 'Auratouched Mage',
>> 'When Auratouched Mage comes into play, search your library for an
>> Aura card that could enchant it. If Auratouched Mage is still in  
>> play,
>> attach that Aura to it. Otherwise, reveal the Aura card and put it
>> into your hand. Then shuffle your library.', '', 0);
>> INSERT INTO products_description VALUES (1, 2, '','','',0);
>> INSERT INTO products_description VALUES (1, 3, '','','',0);
>> INSERT INTO products_to_categories VALUES (1, 2);
>>
>> with card87952 being the cards name.
>>
>> anyone got any ideas that could help me out?
>>
>>
>>
>> The php_mysql group is dedicated to learn more about the PHP/MySQL
>> web database possibilities through group learning.
>> Yahoo! Groups Links
>>
>>
>>
>
>
>
> The php_mysql group is dedicated to learn more about the PHP/MySQL  
> web database possibilities through group learning.
> Yahoo! Groups Links
>
>
>
>
>
>
> ---------------------------------
> Never miss a thing.   Make Yahoo your homepage.
>
> [Non-text portions of this message have been removed]
>
>
>
> The php_mysql group is dedicated to learn more about the PHP/MySQL  
> web database possibilities through group learning.
> Yahoo! Groups Links
>
>
>



The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php_mysql/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to