Giter VIP home page Giter VIP logo

Comments (7)

vigneshuvi avatar vigneshuvi commented on May 25, 2024

Why framework need to ignore the last row?

from swiftcsvexport.

elijah-rappaport avatar elijah-rappaport commented on May 25, 2024

You shouldn't. But you are.

from swiftcsvexport.

vigneshuvi avatar vigneshuvi commented on May 25, 2024

Can you please explain, why we need to ignore the last row?

from swiftcsvexport.

elijah-rappaport avatar elijah-rappaport commented on May 25, 2024

You should not be ignoring the last row. But your framework currently is ignoring it. Try the example and you will see. You will end up with a csv with just one row, which is incorrect.

from swiftcsvexport.

vigneshuvi avatar vigneshuvi commented on May 25, 2024

`
// First User Object
NSMutableDictionary *user1 = [NSMutableDictionary new];
[user1 setValue:@"vignesh" forKey:@"name" ];
[user1 setValue:@"[email protected]" forKey: @"email"];

// Secound User Object
NSMutableDictionary *user2 = [NSMutableDictionary new];
[user2 setValue:@"vinoth" forKey:@"name" ];
[user2 setValue:@"[email protected]" forKey: @"email"];
// Secound User Object
NSMutableDictionary *user3 = [NSMutableDictionary new];
[user3 setValue:@"name" forKey:@"name" ];
[user3 setValue:@"email" forKey: @"email"];


// CSV fields Array
NSMutableArray *fields = [NSMutableArray new];
[fields addObject:@"name"];
[fields addObject:@"email"];

// CSV rows Array
NSMutableArray *data = [NSMutableArray new];
[data addObject:user1];
[data addObject:user2];
[data addObject:user3];




// Create a object for write CSV
CSV *writeCSVObj = [[CSV alloc] init];
writeCSVObj.rows = data;
writeCSVObj.fields = fields;
//writeCSVObj.delimiter = DividerTypeComma;
writeCSVObj.name = @"userlist";

// Write File using CSV class object
CSVResult *outPut = [CSVExport exportCSV:writeCSVObj];
if (outPut.result == ResultValid) {
   NSLog(@"Export Validate.");
} else {
    NSLog(@"Export Invalidate.");
}
// REad cSv file
CSV *readCSV = [CSVExport readCSVObjectFromDefaultPath:@"userlist.csv"];
if (readCSV != nil) {
    NSLog(@"Export Validate.");
} else {
    NSLog(@"Export Invalidate.");
}

`

I tried this input its working fine for both read and write.

from swiftcsvexport.

elijah-rappaport avatar elijah-rappaport commented on May 25, 2024

What you just wrote has nothing to do with the issue.
Your software is supposed to take a csv file as input and convert it to an object.
Please try your software with the attached csv file.
test.txt

from swiftcsvexport.

vigneshuvi avatar vigneshuvi commented on May 25, 2024

Thanks for let me know. Can you please try with latest version 2.0.1??

from swiftcsvexport.

Related Issues (20)

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.