Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
readAsText: Save every line as an element in an array
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joko  
View profile  
 More options Feb 13, 12:34 am
From: Joko <j.koss...@googlemail.com>
Date: Sun, 12 Feb 2012 21:34:11 -0800 (PST)
Local: Mon, Feb 13 2012 12:34 am
Subject: readAsText: Save every line as an element in an array
Hello, I'm new in programming with JavaScript and have just
experiences in Python.
Actually I want to read a file and save every line as an element in an
array. Reading the file works great but I don't understand how I can
write every line to my array.

Thanks in advance ....


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kerri Shotts  
View profile  
 More options Feb 13, 1:25 am
From: Kerri Shotts <kerrisho...@gmail.com>
Date: Sun, 12 Feb 2012 22:25:31 -0800 (PST)
Local: Mon, Feb 13 2012 1:25 am
Subject: Re: readAsText: Save every line as an element in an array

Once it's read, you can split it up, like so:

var myArray = whatIRead.split("\r"); // split on UNIX-style line-endings
(try \r\n or \n, depending on your line endings.)

Should work just fine...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Giacomo Balli  
View profile  
 More options Feb 13, 1:58 am
From: Giacomo Balli <giacomoba...@gmail.com>
Date: Sun, 12 Feb 2012 22:58:14 -0800 (PST)
Local: Mon, Feb 13 2012 1:58 am
Subject: Re: readAsText: Save every line as an element in an array
you might want to clean with regexp first (double returns etc)

On Feb 13, 7:25 am, Kerri Shotts <kerrisho...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joko  
View profile  
 More options Feb 14, 2:32 am
From: Joko <j.koss...@googlemail.com>
Date: Mon, 13 Feb 2012 23:32:06 -0800 (PST)
Local: Tues, Feb 14 2012 2:32 am
Subject: Re: readAsText: Save every line as an element in an array
Worked great! Thank You!

On 13 Feb., 14:25, Kerri Shotts <kerrisho...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »