Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JAVA Program

13 views
Skip to first unread message

bender bender

unread,
Mar 4, 2021, 3:37:29 PM3/4/21
to
Hi I'm tring to write a program with JAVA to evaluate data of csv data
In particular I would extract this information

View data on the presence of men and women in Affori over time.

* Carry out an analysis relating to the last available year. Of the 10 most populous neighborhoods show:
* the proportion of births out of the total
* the proportion of 80+ to the total
* The ratio of minors / number of kindergartens

this is the file
https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing

How could fix it?

regards

Dr.UgoGagliardelli

unread,
Mar 4, 2021, 7:04:00 PM3/4/21
to
What is there to be fixed?

bender bender

unread,
Mar 4, 2021, 7:16:06 PM3/4/21
to
I don't know how to write the code for this exercise

bender bender

unread,
Mar 5, 2021, 12:37:38 PM3/5/21
to
Hi to everyone
with this code

import java.io.*;
import java.util.Scanner;
public class ReadCSVExample1
{
public static void main(String[] args) throws Exception
{
//parsing a CSV file into Scanner class constructor
Scanner sc = new Scanner(new File("data.csv"));
sc.useDelimiter(","); //sets the delimiter pattern
while (sc.hasNext()) //returns a boolean value
{
System.out.print(sc.next()); //find and returns the next complete token from this scanner
}
sc.close(); //closes the scanner
}
}

I obtain print of all csv file
but I woul extract only information about View data the presence of men and women in Affori over time.

How to fix it

Dr.UgoGagliardelli

unread,
Mar 8, 2021, 2:18:44 PM3/8/21
to
Use an already made an tested library, e.g.
https://www.baeldung.com/apache-commons-csv
0 new messages