Anam Abdul Razaq wrote:I have a assignment in which i have to get path of a csv file from the user and then perform various operations on all the data items in it. Size of the data in a file is not fixed.
Apart from the fact that “2D” arrays are not 2D, the thought of multiple arrays fills me with dread. We have already told you to create a class which encapsulates all the data in the line.
Anam Abdul Razaq wrote:If maybe its possible by a 2d array. . . .
Good start. You should always start by writing down the steps with your requirements. I'd say start from the very first tasks.
Anam Abdul Razaq wrote:1) The user is allowed to input a csv or a txt file.
2) The application should handle any data set (big or small)
4) There is going to be only one user of the application.
Not fully yet. Well, not in the way you stated in your requirements earlier.
Anam Abdul Razaq wrote:I have achieved to get a file from the user using JFileChooser.
Please show us relevant part from your most recent code and what kind of exceptions you're getting? (stack trace becomes handful here).
Anam Abdul Razaq wrote:Thanks for a link to fileFilter, but it is throwing a lot of exceptions.
Anam Abdul Razaq wrote:
Knute Snortum wrote:Reading a text file in Java is a little idiomatic, so here's a shell to work with (requires Java 7 or higher):
Knute Snortum wrote:Suppose you have a line of data like this:
California, Oregon, Washington
You have the names of three states in the US separated by a comma and a space. In this situation your separator would be ", ".
1) The user is allowed to input a csv or a txt file....