Code Monkey home page Code Monkey logo

swiftcsvexport's People

Contributors

jeehut avatar norbertovasconcelos avatar vignesh-kumar-p avatar vigneshuvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

swiftcsvexport's Issues

Strange ordering of fields

Am I doing something wrong here, because this code:

let path = CSVExport.export.exportCSV(filename,
                                  fields: ["a", "b", "c"],
                                  values: [["a": 1, "b": 2, "c": 3],
                                           ["a": 4, "b": 5, "c": 6],
                                           ["a": 7, "b": 8, "c": 9]])

...produces this result:

a,b,c
2,1,3
5,4,6
8,7,9

Strange Formatting

First Last Company Address1 Address2 City State Postalcode Country Sender Frontimage Backtext Accentimage Backimage    
Loma Linda Back Image Back Text 2nd Floor Mary Ann Missouri 64804 Fuller 4 States Printing Accent Image Record ID Rusty 12345678 Front Image United States 1234 Appaloosa Way

I am getting strange formatting

Adding Two Spaces

Whenever I am writing a string in a column it adds extra two spaces before that.

How to make header as vertical and values as side by side

in your current case you have handled csv which exports data in horizontal way like header1, header2 etc and then values followed below like value1,value2 etc. Now how can i achieve it like this header 1 -> value 1, header2->value2 etc

Directory for CSV file does not get created in IOS

I am developing an iPhone app using Xcode 9 and Swift 4. I have followed your installation instructions meticulously and I have attempted to create a CSV file. When I run the app the cdv file never gets populated into the directory in the app documents folder . I reviewed the CSVExport.swift file and I see the following code 👍

///get the default CSV directory

class func defaultDirectory() -> String {
    var path = "/SampleSwift"
    let fileManager = FileManager.default
    #if os(iOS)
        let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
        path = "\(path[0])/Exports"
    #elseif os(OSX)
        let urls = fileManager.urls(for: .libraryDirectory, in: .userDomainMask)
        if let url = urls.last?.path {
            paths = "\(url)/Exports"
        }
    #endif
    if !fileManager.fileExists(atPath: path) && path != ""  {
        do {
            try fileManager.createDirectory(atPath: path, withIntermediateDirectories: false, attributes: nil)
        } catch _ {
        }
    }
    return path
}

I have an iPhone 7 plus connected as a test device. I never receive any runtime errors. The console displays the following path for the userlist1.csv file 👍

/var/mobile/Containers/Data/Application/13DB9A0A-774C-45B0-A753-62FF8C56CF11/Documents/Exports/userlist1.csv

How do I get access to that file ? It never gets populated into the apps documents folder and the Exports folder never gets created.

I would appreciate any assistance you can offer .
thanks !
Tom

How to handle comma in address ?

Hi,

after I export an address string to excel I found it split it into 2 column.
example my address is "No 10-20, Tmn Kinrara" but in excel it make "No 10-20" into 1 column and make "Tmn Kinrara" inside another column.

anyway to solve it ?

Using ; as divider

Hi, first of all thanks for your amazing work.

I only have one problem, I cannot set the field divider to semicolon (;) instead of commas.

I've tried:

  let writeCSVObj = CSV()
  writeCSVObj.delimiter = DividerType.semicolon.rawValue
  writeCSVObj.rows = data
  writeCSVObj.fields = headers as NSArray
  writeCSVObj.name = "ExportTest"

as well as:

  let writeCSVObj = CSV()
  writeCSVObj.delimiter = ";"
  writeCSVObj.rows = data
  writeCSVObj.fields = headers as NSArray
  writeCSVObj.name = "ExportTest"

but the output file will always have commas as field dividers. Am I missing something?

SwiftPM in Xcode 12: Failed to resolve dependencies.

When adding this library to an iOS project via Xcodes SwiftPM functionality, I get this error:

because SwiftCSVExport >=1.0.0 contains incompatible tools version and root depends on SwiftCSVExport 2.3.0..<3.0.0, version solving failed.

Quotes in string

When export the file, in the first row every string has '' quotes around it. Is there anyway we can stop this?

StringTest shows as 'StringTest' in the first row.

Support Turkish Characters

It's not supporting Turkish characters. And also CVS format is not correct. I'm using Excel 2019.

image

This is the Turkish characters. ı, ğ, İ, Ğ, ç, Ç, ş, Ş, ö, Ö, ü, Ü

Won't build with Xcode 10.2 - Swift 3.0

Getting the following for SwiftCSVExportOSX after the Xcode update yesterday (3/26/19):

error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'SwiftCSVExportOSX')

Cannot find 'exportCSV' in scope

I was able to add the Package Manager but I am getting this error:

let result = exportCSV(writeCSVObj); --> Cannot find 'exportCSV' in scope

I have already imported SwiftCSVExport

Change cell properties

Is there a way to change a specific cell's background color and text color and/or text font size?

Cocoa pod not working.

Might be there is an issue with the current pod. it is not working on the project. See below image.
the pod is just adding .h file source file is missing.
screen shot 2017-07-12 at 12 39 27 pm

String quotes

Hi,
First of all great library. I am using it for some time for my application. In last version strings didn't have quotes around them, and in this new version, there are. Can you make them optional with some parameter for settings?

I changed: let fString = "(string)" to get rid of quotes.

Thanks

How are you handling quotes and commas?

exportCSV:
Quotes in values are written as they are, which causes problems when opening up in Excel.
Ideally, any " found in values should be turned into "".

readCSV:
Any row with a value that contains a comma seems to be ignored.
(But values with commas do get written fine by exportCSV.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.