Spreadsheet workbook imports/exports 2das for you. Uses file dialogs to locate files/save locations. Will also merge sheettabs together, so you can merge 2das automatically, and then write them to a file. Export routine writes "neat" files (i.e. they're all lined up properly, making them easier to read).
Update 1/9/2017: Fix to get around Excel stripping out quotes on import of a 2da file. Export macro will now check values in cells for embedded spaces. If the string contains embedded spaces, it will add quotes around the string in the output file. Also, there are now two files in the zip. One is still an Office 97-2003 spreadsheet, for those of you still using the older office versions. The other is an xlsm file that should be usable with the newer office versions (I was able to use it in Excel 2016). I was not able to test the 97-2003 version as I don't have an old version of office to test with. If you run into issues, reach out to me via PM, and I'll try to help you out as best I can.
Update: 6/10/2020 - Included the fix listed in the comments to the Import2da function in the .xls (97-2003) version of the spreadsheet.
Update 6/16/2020 - Added a create patch 2da function. Those who have gone exploring through the VBA macro code probably noticed some functions that would create patch/merge sheets, but you had to activate it through running the macros directly instead of a button/UI type set up. I have added a button on the main page to expose that functionality to everyone. In the pop-up, choose the original 2da worksheet to compare to and your custom 2da worksheet and it will strip out all the lines in the custom 2da worksheet that are the same as the original. For the lines that are different, all cells with different values will be set to red text in the custom 2da worksheet This helps the merging of multiple sheets for the same 2da by limiting the rows being merged so you can actually see the row background color differences and know where each row came from.
Update: 6/23/2020 - fixed issue with quoted columns bleeding into the next column for the longest string(s). Removed the Excel 97-2003 version of the spreadsheet as it's now 2020.
Attachment | Size |
---|---|
![]() | 63.6 KB |
![]() | 7.62 MB |
I use this all the time and have for years.
Great utility, but there's a bug if the 2DA file uses quote-delimited strings (e.g. "Bugbear: Chieftain 1") to allow embedded spaces in descriptions. This tool strips out the quotes, corrupting the output.
Just uploaded a fixed version that will write out quotes around strings that contain spaces.
Just found the new vault location as I ran across the Baldur's Gate Reloaded module this weekend and decided to reinstall everything. To comment on Proleric's bug comment from a couple years ago - it is not the spreadsheet "tool" that has the bug, but it is an unfortunate "feature" of Excel. The Excel text import process, which is automated by macro, asks for the text delimiter; if you do not supply it, it will not import the string correctly into one column on import. If you supply it, Excel strips it out on import. Now, that being said, if you type in the quotes in the spreadsheet in Excel, it WILL export them in the output.
This leaves two options on using the tool:
1. Don't use quoted strings with spaces - instead use underscores and TLK entries
2. Once imported into the spreadsheet, update with quotes and never delete the tab with the quoted strings. Use the merge feature to write your changed lines that contain the quotes over top of the other 2da tab that doesn't have quotes. The "new<xxx>" tab will have your quoted strings. Then export that "new<xxx>" tab. You can then remove the "new" tabs later using the "Clean Up" button, and keep your original tab with your quoted strings.
The reason I chose Excel for this is that when developing The Grimoire project, if I ran into TLK conflicts with other packs I was using, I needed a quick way to change all the StrRef values. I added a TLK tab for my content and put in formulas for all the TLK entries on that sheet and then in all my edited 2da sheets. This way I could just update the offsets, and my edited 2da sheets would automagically update, and all I would have to do is rebuild them using the Merge feature. After that, I just had to make sure I update the TLK appropriately in TlkEdit.
Thanks for the update on this.
I, too, had noticed the stripping of quotation marks on import. Still totally worth using your Excel work here. I just ended up doing a little Excel work around to add quotes where needed (an extra worksheet, some quotation marks, and concatenate function do wonders).
I've used this for all my PW 2da editing and for the CEP. Being able to color-code cells is a huge help when scanning through countless lines of information. :)
This excellent, I had my first experience of editing a 2da today and this was simple and easy to use.
There is a bug in the Excel 2003 .xls version which is easily fixed.
In the macro Import2DAFile,
Sheets(1).Move after:=Workbooks("NWN2daTool.xlsm").Sheets(1)
should read
Sheets(1).Move after:=Workbooks("NWN2daTool.xls").Sheets(1)
With that fix, I did a test with appearance.2da (probably the worst case) and ran a compare utility on the results to verify that it's working fine now.
I wasn't able to get the .xlsm version working with Excel 2003, even though I have the compatibility extension for more modern file versions.
Doesn't work at all for me?
@Dark_Ansem - what problem are you seeing, exactly?
EDIT - are you using the right version for your release of Excel?
The .xlsm version works fine for me on Excel 2016.
Can someone update this to add spaces after quotations?