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 6603129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:58:00+00:00 2026-05-25T18:58:00+00:00

I had a CSV file where now i am able to read the CSV

  • 0

I had a CSV file where now i am able to read the CSV File contains as an array now. In my xcode Project i have created a Html file where i have to print the contains of the array on the onclick of a button.How to do this.

The following is the Code of my .m file,

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"Array"ofType:@"html"]isDirectory:NO]]];

NSString *path = [[NSBundle mainBundle] pathForResource:@"Example" ofType:@"csv"];
NSString *contents = [NSString stringWithContentsOfFile:path encoding:NSASCIIStringEncoding error:nil];
NSArray *lines = [contents componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\n,"]];
for (NSString* line in lines) {

    NSLog(@"%@", line);            
}
NSLog(@" %d", [lines count]);

In the Html File, the following is the Code,

<head>
    <title></title>
</head>

<body>
    <script language="JavaScript" type="text/javascript">
        <!--
        var srcFrame;
        //External content into a layer
        function loadOuter(doc) {
            srcFrame = document.getElementById("hiddenContent");
            srcFrame.src = doc;
            // workaround for missing onLoad event in IFRAME for NN6
            if (!srcFrame.onload) {
                setTimeout("transferHTML()", 1000)
            }
        }

        function transferHTML(){
            srcContent='';
            if (srcFrame.contentDocument){
                srcContent=srcFrame.contentDocument.getElementsByTagName("BODY")[0].innerHTML;
            }
            else if (srcFrame.contentWindow){
                srcContent=srcFrame.contentWindow.document.body.innerHTML;
            }
            document.getElementById("outerDisplay").innerHTML = srcContent
        }


        var DocAry=new Array('lines');

        function SelectList(v){
            if (v>0){
                loadOuter(DocAry[v-1]);
            }
        }

        //-->
        </script>

    <INPUT TYPE="button" VALUE="lines" onClick="loadOuter('lines')" >


        <br>



        <div id="outerDisplay"></div>

        <iframe  id="hiddenContent" width="200" height="200" style="position:absolute;visibility:hidden;" ></iframe>

        </body>

I am missing some code,i.e, How to give link so that the array which is in .m file is linked to the Html File,So that in Html file i can display the contents of array on OnClick.

  • 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-05-25T18:58:01+00:00Added an answer on May 25, 2026 at 6:58 pm

    Well, you actually have already almost everything you need. Just split the array lines and get its strings, (you might be looking at objectAtIndex) and save them.

    On the other hand, you need to know where your HTML file is, I am sure you know how to do that. The most convenient solution would be to save the HTML to a string and create a new string with your strings from lines and then save the new string to an html again, either under the same or under another name.

    Please let me know if you had success.

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

Sidebar

Related Questions

I have a Excel .CSV file I'm attempting to read in with DictReader. All
I have a large nested array that I'm generating from parsing a CSV file
I'm using BufferedReader to read a .csv file. I have no problem reading the
I had an application that was downloading a .CSV file from a password-protected website
So I have a CSV file that looks like this: 12345, Here is some
I have this .csv file: ID,GRADES,GPA,Teacher,State 3,C,2,Teacher3,MA 1,A,4,Teacher1,California And what I want to do
I am using the csv module for Python. I have had a good look
I have a CSV file that I'd like to split up based on a
I have csv file with a line that looks something like this: ,,,,,,,,,, That's
I have a csv file as an attachment to the inbox. They should be

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.