George Asda
George Asda

Reputation: 2129

Add multiple keys to plist dictionary [pre-populate it from an excel file beforehand]

Is there an easy way to add multiple keys in a plist and pre-populate?

EDIT: Basically what I want to do is convert my excel document to a plist with the following structure:

I got a simple plist structure:

<key>Alpha</key>
<string>This is the letter alpha</string>
<key>Beta</key>
<string>This is the letter beta</string>

And many data (over 1000) in an excel table:

Column one | Column 2

"This the key" | " this is the string" etc.

Thanks

Upvotes: 0

Views: 382

Answers (2)

user2668287
user2668287

Reputation: 1

I create an add-in Excel function to convert ranges to plist (download the Excel with macro-enabled file from here: https://docs.google.com/file/d/0B9SJEsPaoCzbdFpqMVNEaTZMQUk/edit).

Upvotes: 0

Codo
Codo

Reputation: 78975

Add to more columns to your Excel sheet. On the first row, add these formulas to the two new cells:

="<key>" & A1 & "</key>"
="<string>" & B1 & "</string>"

Then copy the cells into the remaining cells of the new columns. Now you basically have the contents of your plist file. Select it and copy it into the text editor. The key and the value will be on the same line. But that's not relevant, it's just formatting.

Upvotes: 3

Related Questions