Hello Liam,
          Prob is solved now, I migrated the task in php, now all
working fine..

         Thanks a million for posting replies and helping me

regards,
Nitin Sawant

On May 21, 8:38 pm, Liam Byrne <l...@onsight.ie> wrote:
> The code works fine here (apart from the security issue).
>
> I can't understand how or why you'd convert a two-dimensional array to a
> single one, though.
>
> Are you SURE that the page that you're testing has the second comma in
> the following line ? Your original post didn't
>
>             myArr=myArr.replace("\n",",");//this line doesn't work
>
> L
>
>
>
> Nitin Sawant wrote:
> > Hello Liam,
> >       Thanks for your reply,
>
> > i'm retrieving csv file from google finance and parsing it, however
> > the script which i wrote doesn't replace newline char from csv file
> > with comma, I want to convert csv file to javascript array.
>
> > <html>
> > <head>
> > <title>- Another CSV parser -</title>
> > <script type="text/javascript" src="flotr/jquery.js"></script>
> > <script type="text/javascript">
> >     function loadData(){
> >         $.get("http://finance.google.com/finance/historical";,
> >           {
> >                 q:'GOOG',
> >                 startdate:'Apr 1 2009',
> >                 enddate:'May 1 2009',
> >                 start:'225',
> >                 num:'25',
> >                 output:'csv'
> >           },
> >           function(data)
> >           {
> >              // Writing output into div
> >              $("#csvDiv").html(data);
> >              $("#csvDiv").hide();
> >              ConvertToArray(data);
> >           }
> >         );
> >     }
>
> >     function ConvertToArray(data){
> >         var myArr=$("#csvDiv").html();
> >        myArr=myArr.replace("\n",",");//this line doesn't work
> >         myArr=myArr.split(',');
> >         document.writeln("array length is: "+myArr.length+"<br/>");
>
> >         //show all elements of array
> >         var i=0;
> >         for (i; i<myArr.length; i++) {
> >             document.writeln(myArr[i]+'<br />');
> >         }
> >     }
> > </script>
> > </head>
> > <body>
> > <div id="csvDiv">
>
> > </div>
> > <script type="text/javascript">
> >     loadData();
> > </script>
> > <!--
> >    http://finance.google.com/finance/historical?q=GOOG&startdate=May+1%2...
> > -->
> > </body>
> > </html>
>
> > On May 20, 3:56 pm, Liam Byrne <l...@onsight.ie> wrote:
>
> >> That code that you posted is replacing a newline with nothing - the
> >> comma is BETWEEN the parameters and is not one of them
>
> >> Try csvString=csvString.replace('\n',',');
>
> >> Nitin Sawant wrote:
>
> >>> Hello frendz,
> >>>          I'm trying to replace newline char frm Google finance csv
> >>> file with comma but its not happening pls help.
>
> >>>http://finance.google.com/finance/historical?q=GOOG&startdate=May+1%2...
>
> >>> I'm using following code
>
> >>> csvString=csvString.replace('\n','');
>
> >>> I think there is some platform newline char issue.
>
> >>> how to do this using jquery?
>
> >>> pls help
> >>> ------------------------------------------------------------------------
>
> >>> No virus found in this incoming message.
> >>> Checked by AVG -www.avg.com
> >>> Version: 8.5.339 / Virus Database: 270.12.35/2124 - Release Date: 
> >>> 05/20/09 06:22:00
> >>> ------------------------------------------------------------------------
>
> >>> No virus found in this incoming message.
> >>> Checked by AVG -www.avg.com
> >>> Version: 8.5.339 / Virus Database: 270.12.35/2124 - Release Date: 
> >>> 05/20/09 06:22:00

Reply via email to