From f44dfdcc144a03acfab0261783cd21d8da1027a5 Mon Sep 17 00:00:00 2001 From: Playtester Date: Mon, 11 Sep 2006 10:31:49 +0000 Subject: 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 --- tools/item_db.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/item_db.pl') 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=) { 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); -- cgit v1.2.3-60-g2f50