diff options
author | Playtester <Playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-11 10:31:49 +0000 |
---|---|---|
committer | Playtester <Playtester@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-11 10:31:49 +0000 |
commit | f44dfdcc144a03acfab0261783cd21d8da1027a5 (patch) | |
tree | 2593e0112493243df05f074a5a5889e248ad1c81 /tools | |
parent | 3b2ce32fbb2c86cc58053e492acb019943076e92 (diff) | |
download | hercules-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')
-rwxr-xr-x | tools/item_db.pl | 8 |
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); |