Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8744421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:50:18+00:00 2026-06-13T11:50:18+00:00

I am developing a small app where the user uploads a csv file to

  • 0

I am developing a small app where the user uploads a csv file to the document folder in the app through iTunes. I am using the following code, but it checks only the first column in first row. Its not checking the second rows column. My csv file contains 2 rows and 4 columns each. First column is a number. The user will type this number in a text box and click a button to check whether the number is in csv file. The following function is the one I am using

-(void)CheckEntry //this function checks the example.csv file
{
    NSArray *DocumentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *DocumentDirectory = [DocumentPath objectAtIndex:0];

    NSString *FullPath = [DocumentDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"example.csv"]];

    NSString * pstrCSVFile= [NSString stringWithContentsOfFile:FullPath encoding:NSASCIIStringEncoding error:NULL];

    NSArray * paRowsOfCSVFile= [pstrCSVFile componentsSeparatedByString:@"\r\n"];

    NSArray *paColumnsOfRow;
    NSString *pstrFirstColumn;
    for(NSString * pstrRow in paRowsOfCSVFile)
    {
        paColumnsOfRow= [pstrRow componentsSeparatedByString:@","];
        pstrFirstColumn= [paColumnsOfRow objectAtIndex:0];

        if([pstrFirstColumn localizedCaseInsensitiveCompare:GWIDText.text] == NSOrderedSame)
        {
            NSString *msg = [NSString stringWithFormat:@"The record was found"];
            UIAlertView *alertingFileName = [[UIAlertView alloc]initWithTitle:msg message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alertingFileName show];
        }
        else
        {
            NSString *msg = [NSString stringWithFormat:@"Not Found"];
            UIAlertView *alertingFileName = [[UIAlertView alloc]initWithTitle:msg message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [alertingFileName show];
        }
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:50:19+00:00Added an answer on June 13, 2026 at 11:50 am

    Try using componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet] instead of componentsSeparatedByString: and see if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a small app using jquery mobile. I have the following scenario
I am developing a small app for a Motorola 9090-G using .net compact framework
I am developing a small web app that internally authenticates users. Once the user
I recently started developing a small app using the sample provided in this article.
I am developing a small windows app, but have some trouble deciding whether to
I am developing a small app under Linux using the CodeBlocks IDE. I have
I am developing a facebook app using php SDK, my app is small and
i'm developing a small app with Python and Google app engine. I'm using boilerplate
I am developing a small scale app using smart gwt 2.4. I chose smart
I am developing a small game app using Uikit + Uiimages . In the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.