SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 03/05/2014, 12:00 PM   #1
gtakillerIV
Gangsta
 
gtakillerIV's Avatar
 
Join Date: Sep 2011
Location: UAE, Sharjah.
Posts: 986
Reputation: 201
Thumbs up Ini->Sql v1.2 - Convert .ini Files to SQL Queries!



v1.2

Hello everybody!

I'm pretty sure some of you wanted to switch to MySQL but converting the accounts to SQL was your biggest problem.
I had that same problem but luckly I knew how to program so I made a program in C++ that'll convert my .ini files to SQL queries and it worked perfectly fine, but it wasn't dynamic.
So I've decided to create this app to help all those people out there that want to switch to MySQL to enjoy all of the features MySQL has to offer.

What's this?

It's a .ini to MySQL converter that'll convert all of your .ini files to multiple MySQL INSERT queries.

There's already one!

Yes, I'm fully aware that there is one that is made by gamer931215 found here.

Why didn't I use it you might say?

Because it always crashed/froze when I loaded huge amount of files to it! And sometimes it didn't even work at all.

What do I bring to the table?

My program can take huge amounts of files and convert them(the whole purpose of me creating it), and not only that; I also do some checking under the hood to validate the files(of course it's not gonna remove all the invalid files, but should exclude most!).

Okay, I ran out of questions! Just show me the features.

1)An option to ignore duplicate errors upon executing the INSERT query.
2)Allow you to skip files if their columns don't match the one that I've stored(from the first account file).
3)You can tell the program if your .ini file has the player's username in one of the enteries or not. If there isn't, you can choose a column name for it and it'll get the name of the player automatically for you assuming that the .ini file is named after the player.
4)A popup telling you that the program has done converting.
5)A progress bar that'll show you the progress.

Check Github for more.

Note: I have only tested this on a .ini file that was created using y_ini, but it should work for other systems like dini, because I take care of the spacing between the equal(=) sign.

Screenshots





Converting 48,796 accounts(excluding the invalid ones).



Took me about 33.5 seconds(I'm not using an SSD).

Speed will depend on how good your PC(especially the HDD/SDD) is and how much data you store inside of your .ini file.

How to use?

1)Click on the browse button.

2)Locate the folder where you have your .INI files stored.

3)Locate the folder where you want to store the converted accounts.

4)Change the "table name" text box to your table name.


Optional
ē If you donít want to ignore duplicate errors, uncheck Ignore duplicate errors.

ē If your file doesnít contain the playerís username, uncheck File contains username and enter in a column name for your usernames in the textbox below.
Example: In my table Iíve got a column named usernames and my .INI files donít contain the userís name but each .INI file is named after the player it was created for. Iíll uncheck file contains username and in the textbox below it, Iíd write usernames.

ē If you donít want to skip files that have missing columns in them, uncheck Skip file if itís missing columns.

Added in v1.2

ē If you want to change your column names, youíll have to double click on the column you want to rename in the column list to your right.



Bugs

None currently.
I'm not the best programmer in the world so there might be a few bugs here and there
I'd also like to say that this program was just a fun project I was doing since I was bored.

Download

Github

Feedback is highly welcome.
If you're gonna give negative feedback, then please say why and what I can do to improve your experience using my program. Don't expect me to improve it if you just say "It's terrible" without saying why. I can't guess what you hated about it, can I?

Thanks.

Last edited by gtakillerIV; 06/11/2014 at 04:31 PM.
gtakillerIV is offline   Reply With Quote
Old 03/05/2014, 12:02 PM   #2
Krisna
Big Clucker
 
Krisna's Avatar
 
Join Date: Jan 2013
Location: Indonesia
Posts: 162
Reputation: 10
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Nice tool !!
__________________
leave samp, play osu!
Krisna is offline   Reply With Quote
Old 03/05/2014, 12:12 PM   #3
]Rafaellos[
Gangsta
 
Join Date: Feb 2012
Location: Cyprus
Posts: 731
Reputation: 48
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Is there any way of getting Username from the file name? I mean in YINI I don't have a Username column and in SQLite I do.
__________________
]Rafaellos[ is offline   Reply With Quote
Old 03/05/2014, 12:13 PM   #4
gtakillerIV
Gangsta
 
gtakillerIV's Avatar
 
Join Date: Sep 2011
Location: UAE, Sharjah.
Posts: 986
Reputation: 201
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

That's where the "File contains username" comes in handy. Untick it and then replace "Username column name" with the column name in your database. After that you should be good to go.
gtakillerIV is offline   Reply With Quote
Old 03/05/2014, 12:46 PM   #5
Ha$H_Sexyboy
Huge Clucker
 
Ha$H_Sexyboy's Avatar
 
Join Date: Nov 2011
Location: Currently in SA
Posts: 364
Reputation: 37
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Great job !
__________________
Ha$H_Sexyboy is offline   Reply With Quote
Old 03/05/2014, 12:49 PM   #6
Tamer
High-roller
 
Tamer's Avatar
 
Join Date: Nov 2011
Location: Turkey
Posts: 1,103
Reputation: 172
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Good idea, It will be useful for the ones who want to turn their script to MySQL from ini.
__________________
The three stages of truth:

- Ridicule.
- Violent opposition.
- Acceptance.


Quote:
The greatest hypnotist on the planet Earth is an oblong box in the corner of the room. It is constantly telling us what to believe is real. If you can persuade people that what they see with their eyes is what there is to see you've got them. you know because they'll laugh in your face of an explanation that portrays the biggest picture of what's happening... and they have.
Tamer is offline   Reply With Quote
Old 03/05/2014, 01:27 PM   #7
gtakillerIV
Gangsta
 
gtakillerIV's Avatar
 
Join Date: Sep 2011
Location: UAE, Sharjah.
Posts: 986
Reputation: 201
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Thanks for the feedback!
gtakillerIV is offline   Reply With Quote
Old 03/05/2014, 01:45 PM   #8
NewerthRoleplay
High-roller
 
NewerthRoleplay's Avatar
 
Join Date: Nov 2011
Location: England :: The Danger Zone
Posts: 1,014
Reputation: 133
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

The notifications are a great touch, good work
__________________
NewerthRoleplay is offline   Reply With Quote
Old 03/05/2014, 03:04 PM   #9
iRaiDeN
Huge Clucker
 
iRaiDeN's Avatar
 
Join Date: Mar 2014
Location: Israel
Posts: 481
Reputation: 41
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Very Nice! +REP.
iRaiDeN is offline   Reply With Quote
Old 03/05/2014, 03:47 PM   #10
]Rafaellos[
Gangsta
 
Join Date: Feb 2012
Location: Cyprus
Posts: 731
Reputation: 48
Default Re: Ini->Sql - Convert .ini Files to SQL Queries!

Quote:
Originally Posted by gtakillerIV View Post
That's where the "File contains username" comes in handy. Untick it and then replace "Username column name" with the column name in your database. After that you should be good to go.
It wasn't mention in the first post, or I didn't understand it. Thanks, it's gonna help me a lot.
__________________
]Rafaellos[ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
queries. audriuxxx Scripting Help 1 01/12/2013 03:11 PM
How to convert server files from 0.3e version into 0.3c version Sajed Scripting Help 2 29/10/2013 08:48 PM
Double O Files 2 load files problme yos136 Scripting Help 7 29/03/2013 01:48 PM
Open all user files at the same time and then convert passwords and save cssbart Scripting Help 0 18/08/2012 08:28 PM
Way to change .map (MTA Map) files to .pawn (SAMP Files)- luey41 Scripting Help 6 31/07/2012 12:26 AM


All times are GMT. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.