Path: csiph.com!aioe.org!a+OD18ggP/kJ5LFzD5K8gA.user.gioia.aioe.org.POSTED!not-for-mail From: "Dr.UgoGagliardelli" Newsgroups: it.comp.java Subject: Re: JAVA Program Date: Mon, 8 Mar 2021 20:20:32 +0100 Organization: Aioe.org NNTP Server Lines: 52 Message-ID: References: <9295e77f-01ca-4886-a355-00f92b0783e8n@googlegroups.com> <9041074e-4385-4d7b-a669-e442864fabb4n@googlegroups.com> <4ab6386d-c5f4-4568-b307-27de7e40be40n@googlegroups.com> NNTP-Posting-Host: a+OD18ggP/kJ5LFzD5K8gA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: it X-Antivirus-Status: Clean X-Antivirus: Avast (VPS 210308-0, 08/03/2021), Outbound message Xref: csiph.com it.comp.java:9380 Il 05.03.2021 18.37, bender bender ha scritto: > Il giorno venerdì 5 marzo 2021 alle 01:16:06 UTC+1 bender bender ha scritto: >> Il giorno venerdì 5 marzo 2021 alle 01:04:00 UTC+1 Dr.UgoGagliardelli ha scritto: >>> Il 04.03.2021 21.37, bender bender ha scritto: >>>> 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 >>>> >>> What is there to be fixed? >> I don't know how to write the code for this exercise > > > 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 > Use an already made an tested library, e.g. https://www.baeldung.com/apache-commons-csv