Convert Excel document (xls) to a plist

2019-01-16 06:45发布

I have a pretty straightforward Excel spreadsheet, and I need to use the data in an iPhone app. The xls document has 6 columns, and > 200 rows.

I would like to create a plist from the xls document. How can I convert one to the other, programmatically?

标签: iphone plist xls
7条回答
对你真心纯属浪费
2楼-- · 2019-01-16 07:37

You could do this using a simple formula that you copy and pasted down a column beside each of your 200+ rows.

For example, assuming colum A contains a list of names, and column B contains a matching set of ages you could use a formula such as the following to end up with most of the XML for a plist based dictionary.

=CONCATENATE("<key>Name</key><string>", A1,"</string><key>Age</key><integer>",B1,"</integer>")

You then select all the cells within this new column you can copy and paste into notepad or another text editor to save it as a plist file (you may want to put some hardcoded text into a cell above and below your 200+ rows, in order to get the required tags etc as well...

查看更多
登录 后发表回答