Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
A general question, convert to database and back
Old 05-26-2008, 05:06 AM A general question, convert to database and back
Junior Talker

Posts: 1
Trades: 0
Ok, so this is my first post here, i dont know if this is the right place but there is something i need to know and there might be some ppl here with the answare.

I'm administrating a multiplayer game that its “database” is based on txt files with fields, every player txt file looks like this:
Code:
password=1234
ip=128.125.368.28
laston=15/04/2008
money=56847
health=79
amour=96
Something like this.
Now, i got something like 2000 files like that.
When i wanna make a range action to all the players, for ex. change all players money or something i cant do it..
My question is, if there's any way to convert the "database" to something like excel/access i dunno, make the modification, and then convert it back into the files?
Does anyone know of a way to do something like that?
Sorry that i dont understand in all this db stuff.. i'm a game mod programmer.. :\

Thank you!

Last edited by MidoBan; 05-26-2008 at 05:10 AM..
MidoBan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-26-2008, 12:23 PM Re: A general question, convert to database and back
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
There are ways to do that, depending on what kind of server script you are running, but it might not be the most efficient way. I would really recommend using an actual database for this rather than text files, especially if you're storing passwords. Text files are viewable to the web (all you have to do is enter the address), whereas a database should not be. What I would suggest is creating a database for this information and then writing a script that parses your 2,000+ files automatically and enters them in the database. From there, it should be easy enough to manipulate your info.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-27-2008, 03:43 PM Re: A general question, convert to database and back
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Why would you want to load these into a database, make a change, only to dump the info back out to the file system?

You can make sweeping, mass changes the way things are now. How do you read in and write out file data now? You would just do the same thing, in a loop, for all files. It might take a little longer than only doing one, but it'll be essentially the same code. I agree that isn't likely to be very performant, but that's a different question.

If I was going to build a database and an ETL, I'd be sure to get more value than that out of it!

That said, you can get Access to read and write flat files. I'd guess yours is delimited by the equals sign?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to A general question, convert to database and back
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11841 seconds with 12 queries