Re: Reading/Writing from files
reverendlinux <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <84ed921a-906a-4134-b69e-08b168e1acf7@og8g2000pbb.googlegroups.com> |
On Feb 21, 7:51 am, Shibu Narayanan <[email protected]> wrote: > Hi, > > I am trying to read/write from files. I am able to read from properties file using sample code available from the net. > > Is there a good way to read line by line from a file. The content I like to read is not Key/Value pairs. > > -Shibu Have you read through this: https://developer.mozilla.org/en/Code_snippets/File_I%2F%2FO There is a sample code for reading a file line-by-line. Although it's use is cautioned against due to performance issues, I have been using it in an app locally and have seen no problems. Your mileage may vary. Also, the example is for reading ASCII only. If you are working with files containing non-ASCII characters, you might want to read through https://developer.mozilla.org/en/Reading_textual_data as well. Hope this helps.