first things first im gona say hi being the new member to the forum(don't know if this is prerequisite or not) but anyway im wondering about those 2 IO method, what are their differences and when i should use them and also their advantage and disadvantage if there is such?

Convenience class for reading character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are appropriate. To specify these values yourself, construct an InputStreamReader on a FileInputStream.

FileReader is meant for reading streams of characters. For reading streams of raw bytes, consider using a FileInputStream.

ah, i see, so basically filereader can only read whats on the surface? where as fileinputstream reads below that surface which can reads more than whats on the surface eh... great, thanks for sharing Turtle

02-02-2010, 09:07 AM

Cbani

so can i use FileReader to read .csv and .text files?

02-02-2010, 09:36 AM

Turtle

Hi Cbani,

You can use FileReader to read .csv and .txt files as both file types are files that contain characters.

If you are using Excel to edit your csv file, try open it with notepad. You will see that each column is delimited by commas. Knowing this will help you read in data.

To process a csv file you will want to access those values which are delimited by commas. The split method of the String class can archeive this: See String.split(String Regex)