Jump to content

file reading questions


kelphyr

Recommended Posts

http://gamingtwilight.com/rodb/item_db.txt

 

This is the file I need to play with... but like I said, there's no way I can do anything without detecting an end of line. Because I wana like do:

 

Read Line

Process...

Then Read the second line... and just keep going.

 

I need to infuse it into a mysql database but there's no way to do taht without being able to read the fiel properly and no one has been able to help me so far. It's as if no one has file manipulating experience. Id do something like this:

 

$line = 0

While(not end of FILE){

 

While(not end of LINE){

read the line

process the line(cant do that cuz i dont know how to separate my stuff with " , " as " this, this, this "

}

$line = $line + 1

}

 

....

So Im basicly stuck to this part... how do i detect an end of line and how can i separate my content with ","...

yes by line numbers

 

basicly i just wana read line by line and if it does not start by //(which is a comment)

then process it and add it to the mysql database. But I also need a way to read "john,bob,george" inbetween "," and put those into variables and then send it to teh db.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.