5

I have an Excel document with some tables and a lot of data points. I'd like to read from it to populate some UICollectionView cells and other parts of my app.

Something like:

Country | Temperature | Cost
-----------------------------
Spain   | 23          | 80
France  | 26          | 60
Italy   | 31          | 120

I'd like an external database so I can change the info without having to update the app. I use Firebase in my other apps but I don't want to rely on something I might have to pay for in the future.

So I was thinking of turning the Excel doc into a Google Sheet and reading from that using the API. But am I just making my life more difficult? It seems like a clunky solution.

sinio
  • 701
  • 1
  • 9
  • 18

3 Answers3

6

1- Open Excel and export the file as CSV

2- Use this Link to read it as array

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
3

If you don't need to edit the Excel document and it's stored in the new XLSX format, there's an open-source library written in Swift that allows you to parse this file and read the cell data from it: CoreXLSX.

Max Desiatov
  • 5,087
  • 3
  • 48
  • 56
-5

Excel is not precisely a database or a datastore. If you want an app then build an app - that means having a datastore/database and a User Interface, UI. As for updating data points you can automate that (preferable) or you can use your UI to manually update.

Ronnie Royston
  • 16,778
  • 6
  • 77
  • 91
  • What would be a way of automating it? The data wouldn't be user data, but more like extra content. – sinio Jul 14 '18 at 18:06
  • If the data source does not have a means to push on update, you'll have to stand up a server, maybe a node.js server, to periodically ask the endpoint what it's got. – Ronnie Royston Jul 14 '18 at 19:21