Skip to content

roMummy/excel2csv

Repository files navigation

excel2csv

使用CoreXLSXDHxlsReader,支持excel文件(包括xls和xlsx格式)转csv文件

使用

  • 支持使用fastlane自己构建xcframework,已经编译好的xcframework
let path = Bundle.main.path(forResource: "222", ofType: "xls")
// let path = Bundle.main.path(forResource: "111", ofType: "xlsx")

// to csv
do {
  let csvPath = try ExcelReaderCore.shared.convertToCSV(path: path!)
  print("成功 - \(csvPath)")
} catch {
  print("失败 - \(error.localizedDescription)")
}

// to txt
do {
  let txtPath = try ExcelReaderCore.shared.convertToTXT(path: path!)
  print("成功 - \(txtPath)")
} catch {
  print("失败 - \(error.localizedDescription)")
}