CoreXLSX
CoreXLSX copied to clipboard
Unable to parse excel with following code
I am using main branch which i have installed using following pod
pod 'CoreXLSX'
I am trying to read one excel but its giving me random integer number instead of string.
func getExcelData(pathNew: URL) {
let k: UInt32 = 10 * 1024 * 1024
guard let file = try? XLSXFile(data: Data(contentsOf: pathNew), bufferSize: k, errorContextLength: 10) else {
return }
do {
for wbk in try file.parseWorkbooks() {
for (name, path) in try file.parseWorksheetPathsAndNames(workbook: wbk) {
if let worksheetName = name {
print("This worksheet has a name: \(worksheetName)")
}
let worksheet = try file.parseWorksheet(at: path)
let array = worksheet.data?.rows.map { $0.cells.map { $0.value ?? "" } }
}
}
} catch {
print(error)
}

Same here using func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL])
if I converted urls.first!.path it does not read the xlsx document
I tried the both
XLSXFile(filepath: ) XLSX(data: )
But it still does not read the file
@tburnt please refer to #160 WRT document picker. Are you providing a security scoped access URL, as described in a solution for this issue? https://github.com/CoreOffice/CoreXLSX/issues/160
Also, your issue does not seem to be related to the OP. If your issue is not resolve with security scoped access URLs, please create a new issue. Thanks.
Hello thanks for the fast response I tried #160 as well however I had no luck in opening the excel file
Please create a separate issue and provide additional details there: the exact error message and error type you're seeing, the file you're trying to open, and a self-contained sample project to reproduce. Providing these details will allow me to quickly resolve the issue. Thanks!
Because the cells refer shared string. Follow this guide - https://github.com/CoreOffice/CoreXLSX#shared-strings