summaryrefslogtreecommitdiff
path: root/tools/item_db.pl
diff options
context:
space:
mode:
authorPlaytester <Playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-11 10:31:49 +0000
committerPlaytester <Playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-11 10:31:49 +0000
commitf44dfdcc144a03acfab0261783cd21d8da1027a5 (patch)
tree2593e0112493243df05f074a5a5889e248ad1c81 /tools/item_db.pl
parent3b2ce32fbb2c86cc58053e492acb019943076e92 (diff)
downloadhercules-f44dfdcc144a03acfab0261783cd21d8da1027a5.tar.gz
hercules-f44dfdcc144a03acfab0261783cd21d8da1027a5.tar.bz2
hercules-f44dfdcc144a03acfab0261783cd21d8da1027a5.tar.xz
hercules-f44dfdcc144a03acfab0261783cd21d8da1027a5.zip
Added D-Kalck's fix of the TXT -> SQL converter
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8702 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'tools/item_db.pl')
-rwxr-xr-xtools/item_db.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/item_db.pl b/tools/item_db.pl
index f176a949f..7edf3f0a0 100755
--- a/tools/item_db.pl
+++ b/tools/item_db.pl
@@ -2,6 +2,8 @@
$db = "item_db";
$nb_columns = 22;
@str_col = (1,2,19,20,21);
+$line_format = "([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),(\{.*\}),(\{.*\}),(\{.*\})";
+#$line_format = ;
$create_table = "#
# Table structure for table `item_db`
#
@@ -43,7 +45,11 @@ while ($ligne=<STDIN>)
{
printf("# %s\n", $ligne);
} else {
- @champ = split (",(?![^{]*[})])",$ligne);
+ if ($ligne =~ $line_format) {
+ @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22);
+ } else {
+ @champ = ();
+ }
if ($#champ != $nb_columns - 1)
{
printf ("# WARNING BAD LINE : %d (%s)\n", $#champ, $ligne);