Closed albuch closed 5 years ago
That's be cause the system cannot properly determine that it is an array of strings in the first field. The header is essentially saying that it is a 24byte field.
Which is correct as it's number of elements * 4 bytes for each location of the string in the file, no?
Yes
Please let me know if I get this right:
for a WDC2 file the field_size for the offset of a regular string is 32 (= 4 byte) and in this case its 192 (= 24 byte). So the parser could find out that it's an array of offsets rather than for a single string. But it currently doesn't. I wouldn't expect the extended column data (I guess that's what you are referring as header) to be any different than what it is now as all other entries define other value types (indexed, arrays with fixed length types etc.).
I'm not sure about how inline strings from hotfixes would work though as I don't have an example at hand to check the extended column info.
The parser understands it is an array, and the data is parsed correctly. The fact that the debug output does not see it as an array is just a display issue on the debug output.
The issue preventing it from working is that WDC2 requires a new kind of string offset handling (compared to WDC1), and that process does not currently take into account arrayed string fields.
I have a fix locally, I'll push it later today or tomorrow, likely.
Should be fixed in 53a956884003c3236a57e21eba068ca3d9bfed7f
I can confirm that the fix solves the issue. Thanks!
I'm trying to extract data from a db2 file (
BattlePetEffectProperties.db2
) that has an array of strings as one column. See https://github.com/wowdev/WoWDBDefs/blob/master/definitions/BattlePetEffectProperties.dbd for table definition.When extracting the data with dbc_extraxt.py as a csv the following error is shown:
As you can see form the
Field0
definition the elements property of the column format (see below for column definition) is missing.I'd be happy to contribute a PR but failed to find out where the root cause lies as the program is not very well structured and easy to read. So any hint where to look would be appreciated.
Expected behavior
dbc_extract.py doesn't through an exception and extracts the data.
To Reproduce
dbc_extract.py -b ${WOW_VERSION} -t csv -p ${PATH_TO_DBFILESCLIENT} BattlePetEffectProperties > BattlePetEffectProperties.csv
Additional information