Parse html

Reply

Join Date: Oct 2007
Posts: 6
Reputation: ramirez is an unknown quantity at this point 
Solved Threads: 0
ramirez ramirez is offline Offline
Newbie Poster

Re: Parse html

 
0
  #11
Oct 8th, 2007
Originally Posted by Puckdropper View Post
Take a moment and look at what will always be the same in your file.
1. Are the "fittings" from a standard set?
2. Is each blank line guaranteed to be there?
2a. What about line endings? (Does an EOL mean end of item slot?)
3. Can "fittings" go in a different place on your "vessel" or are they one position only?
3a. If they can go multiple places, does the order of the list matter?
1. The fittings are the selections of playes from a data base of >1000 items
2. yep. Each blank line sets the next slot
2a. as above
3. Each ship has ALWAYS 4 slots. High, med, low and rig slots, but the player doesn't have to use them all (there are a lot of crazy people in the game )
3a. Ther order of the slots in the file is, Low - Med - High - Rig (always).
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Parse html

 
0
  #12
Oct 8th, 2007
Ok, now that I understand how your file is set up, I can offer some advice:

Your file relies on line endings and blank lines to seperate data. By looking for them and taking everything from the previous EOL+1 (end of line) to the current EOL you've got your item. (This is a string-centric view.)

Reading in a file makes this process easy. As you read each line, you'll have your items, or an EOL character. You can then do as you wish with the item (you may need to chop() it first) such as compare it to a list of items appropriate to the slot you're reading, or simply adding it to the appropriate place in the database. If it's an EOL, don't worry. The database accepts NULL values (unless someone used the NOT NULL option.)

Why don't you try it and see if you can do it now?
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC