Question

Use the csv file on spotify from any date

In java and linked list Problem Description A record label executive received text files that contain the top streamed musicData Representation Each file is a text file (data comes from SpotifyCharts.com) in comma separated value (CSV) format. It coTurning it in 1. Download a csv file from SpotifyCharts or anywhere. For this assignment you may choose to download any date

Code from lab2

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class SongsReport {

   public static void main(String[] args) {
      
       //loading name of file
       File file = new File("songs.csv"); //reading data from this file
       //scanner to read java file
       Scanner reader;
       //line to get current line from the file
       String line="";

       //length of possible maximum length of records in the file
       int maxArtistPossible = 1000;

       //initialize array with the help of maxArtistPossible
       String artists[] = new String[maxArtistPossible];
       //another array to store the count for each artist
       int artistsCount[] = new int[maxArtistPossible];

       //it will store the actual number of records read from the file
       int currentIndex=0;
       //reset count to zero
       for(int i=0;i            artistsCount[i] = 0;
       }
       //store total number of songs
       int songRecordCount=0;

       //try block to read the file
       try {
           //start file reader
           reader = new Scanner(file);
           //check if reader has more lines to read
           while(reader.hasNextLine()){
               //increase the song count by one
               songRecordCount++;
               //read line
               line = reader.nextLine();
               //split current line by character
               String columns[] = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)");

               //after split artist name will be at possition 2
               //Artist will be at position 2
               String tmpArtist = columns[2];

               //remove quotes from the line
               tmpArtist = tmpArtist.replaceAll("\"", "");
               //now artist list also can have many artist in it. So split that by comma
               for(String art : tmpArtist.split(",")){
                   boolean found = false;
                   //loop and check if current artist already in list or not
                   for(int i=0;i                        //if artist found in the list
                       if(art.equalsIgnoreCase(artists[i])){
                           //increase it's count by one
                           artistsCount[i]++;
                           found = true;
                           break;
                       }
                   }
                   //if artist not found in the list
                   if(!found){
                       //make new entry in the list
                       artists[currentIndex] = art;
                       artistsCount[currentIndex]=1;
                       currentIndex++;
                   }
               }
           }
       } catch (FileNotFoundException e) {
           System.out.println("file not found");
       }

       //print data
       System.out.println("Total song loaded : "+songRecordCount);
       System.out.println("Total unique artist count is : "+currentIndex);
       System.out.printf("%-25s%s\n","Artist","Occurence count");
       for(int i=0;i            System.out.printf("%-25s%s\n",artists[i],artistsCount[i]);
       }
   }


}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SongsReport.java

package c10;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class SongsReport {

   public static void main(String[] args) {
      
       //loading name of file
       File file = new File("songs.csv"); //reading data from this file
       //scanner to read java file
       Scanner reader;
       //line to get current line from the file
       String line="";

       //length of possible maximum length of records in the file
       int maxArtistPossible = 1000;

       //initialize array with the help of maxArtistPossible
       String artists[] = new String[maxArtistPossible];
       //another array to store the count for each artist
       int artistsCount[] = new int[maxArtistPossible];

       //it will store the actual number of records read from the file
       int currentIndex=0;
       //reset count to zero
       for(int i=0;i<artistsCount.length;i++){
           artistsCount[i] = 0;
       }
       //store total number of songs
       int songRecordCount=0;

       //try block to read the file
       try {
           //start file reader
           reader = new Scanner(file);
           //check if reader has more lines to read
           while(reader.hasNextLine()){
               //increase the song count by one
               songRecordCount++;
               //read line
               line = reader.nextLine();
               //split current line by character
               String columns[] = line.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)");

               //after split artist name will be at possition 2
               //Artist will be at position 2
               String tmpArtist = columns[2];

               //remove quotes from the line
               tmpArtist = tmpArtist.replaceAll("\"", "");
               //now artist list also can have many artist in it. So split that by comma
               for(String art : tmpArtist.split(",")){
                   boolean found = false;
                   //loop and check if current artist already in list or not
                   for(int i=0;i<currentIndex;i++){
                       //if artist found in the list
                       if(art.equalsIgnoreCase(artists[i])){
                           //increase it's count by one
                           artistsCount[i]++;
                           found = true;
                           break;
                       }
                   }
                   //if artist not found in the list
                   if(!found){
                       //make new entry in the list
                       artists[currentIndex] = art;
                       artistsCount[currentIndex]=1;
                       currentIndex++;
                   }
               }
           }
       } catch (FileNotFoundException e) {
           System.out.println("file not found");
       }

       //print data
       System.out.println("Total song loaded : "+songRecordCount);
       System.out.println("Total unique artist count is : "+currentIndex);
       System.out.printf("%-25s%s\n","Artist","Occurence count");
       for(int i=0;i<currentIndex;i++){
           System.out.printf("%-25s%s\n",artists[i],artistsCount[i]);
       }
   }


}

songs.csv

1,"WAP (feat. Megan Thee Stallion)","DJ Snake,A,B,C,D",7175768,https://open.spotify.com/track/4Oun2ylbjFKMPTiaSbbCih
2,Hawái,"Maluma,B,C",https://open.spotify.com/track/1yoMvmasuxZfqHEipJhRbp
3,"Mood (feat. Iann Dior)",24kGoldn,5627942,https://open.spotify.com/track/3tjFYV6RSFtuktYl3ZtYcq
4,Dynamite,BTS,4450166,https://open.spotify.com/track/0t1kP63rueHleOhQkYSXFY
5,"Blinding Lights","The Weeknd",4127373,https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b
6,"Watermelon Sugar","Harry Styles",4125160,https://open.spotify.com/track/6UelLqGlWMcVH1E5c4H7lY
7,"Savage Love (Laxed - Siren Beat)","Jawsh 685",4078863,https://open.spotify.com/track/1xQ6trAsedVPCdbtDAmk0c
8,"Laugh Now Cry Later (feat. Lil Durk)",Drake,3844126,https://open.spotify.com/track/2SAqBLGA283SUiwJ3xOUVI
9,"ROCKSTAR (feat. Roddy Ricch)",DaBaby,3841121,https://open.spotify.com/track/7ytR5pFWmSjzHJIeQkgog4
10,"Ice Cream (with Selena Gomez)",BLACKPINK,3419659,https://open.spotify.com/track/2J4P46vCFm1rPkNkp9pZWX
11,"For The Night (feat. Lil Baby & DaBaby)","Pop Smoke",2827320,https://open.spotify.com/track/0PvFJmanyNQMseIFrU708S
12,"Roses - Imanbek Remix","SAINt JHN",2816001,https://open.spotify.com/track/2Wo6QQD1KMDWeFkkjLqwx5
13,"Head & Heart (feat. MNEK)","Joel Corry",2784128,https://open.spotify.com/track/6cx06DFPPHchuUAcTxznu9
14,"Mood Swings (feat. Lil Tjay)","Pop Smoke",2779526,https://open.spotify.com/track/5rZlwNFl01HqLWBQGryKSm
15,"Breaking Me",Topic,2723779,https://open.spotify.com/track/3H7ihDc1dqLriiWXwsc2po
16,Heather,"Conan Gray",2693053,https://open.spotify.com/track/4xqrdfXkTW4T0RauPLv3WA
17,"Ay, DiOs Mío!","KAROL G",2601377,https://open.spotify.com/track/7x4ASXYEKfQBCewcZhK776
18,"UN DIA (ONE DAY) (Feat. Tainy)","J Balvin",2423264,https://open.spotify.com/track/0EhpEsp4L0oRGM0vmeaN5e
19,Caramelo,Ozuna,2348795,https://open.spotify.com/track/5Jm4w8jmPEBTLjI9vH4fXo
20,"Come & Go (with Marshmello)","Juice WRLD",2266324,https://open.spotify.com/track/2Y0wPrPQBrGhoLn14xRYCG
21,"La Curiosidad","Jay Wheeler",2253705,https://open.spotify.com/track/4HYDUMY0xSpeBr0AMY9cUz
22,"Lemonade (feat. Gunna, Don Toliver & NAV)","Internet Money",2237706,https://open.spotify.com/track/2DQNYMRjisN3KAPj1bEwOI
23,"Dance Monkey","Tones And I",2169055,https://open.spotify.com/track/1rgnBhdG2JDFTbYkYRZAku
24,"Rain On Me (with Ariana Grande)","Lady Gaga",2155506,https://open.spotify.com/track/7ju97lgwC2rKQ6wwsf9no9
25,"Tattoo - Remix with Camilo","Rauw Alejandro",2139914,https://open.spotify.com/track/4ZRrLHqzhGRXYj2qcB4s5S
26,"La Jeepeta - Remix","Nio Garcia",2136612,https://open.spotify.com/track/6bvfJf4KjonPMuPfGfy3S2
27,"Midnight Sky","Miley Cyrus",2123506,https://open.spotify.com/track/27ycaQnQAxaPiyeg3nr2aB
28,"you broke me first","Tate McRae",2011917,https://open.spotify.com/track/45bE4HXI0AwGZXfZtMp8JR
29,Relación,Sech,1997251,https://open.spotify.com/track/3ZG8N7aWw2meb6UrI5ZmnZ
30,"Smile (with The Weeknd)","Juice WRLD",1991451,https://open.spotify.com/track/6wQlQrTY5mVS8EGaFZVwVF
31,"Someone You Loved","Lewis Capaldi",1956091,https://open.spotify.com/track/7qEHsqek33rTcFNT9PFqLf
32,"Wishing Well","Juice WRLD",1952331,https://open.spotify.com/track/2U5WueTLIK5WJLD7mvDODv
33,"WHATS POPPIN (feat. DaBaby, Tory Lanez & Lil Wayne) - Remix","Jack Harlow",1909164,https://open.spotify.com/track/2MbdDtCv5LUVjYy9RuGTgC
34,"death bed (coffee for your head)",Powfu,1883548,https://open.spotify.com/track/7eJMfftS33KTjuF7lTsMCx
35,"Before You Go","Lewis Capaldi",1877418,https://open.spotify.com/track/2gMXnyrvIjhVBUZwvLZDMP
36,"Agua (with J Balvin) - Music From ""Sponge On The Run"" Movie",Tainy,1862656,https://open.spotify.com/track/1pqnQ41XbfKjaFu6M0eGJp
37,"POPSTAR (feat. Drake)","DJ Khaled",1824049,https://open.spotify.com/track/6EDO9iiTtwNv6waLwa1UUq
38,"GREECE (feat. Drake)","DJ Khaled",1819219,https://open.spotify.com/track/35RJhm1pEovTBwnNR0zWad
39,"Go Crazy","Chris Brown",1810541,https://open.spotify.com/track/1IIKrJVP1C9N7iPtG6eOsK
40,"Hit Different",SZA,1739926,https://open.spotify.com/track/7Bar1kLTmsRmH6FCKKMEyU
41,"Don't Start Now","Dua Lipa",1733954,https://open.spotify.com/track/3PfIrDoz19wz7qK7tYeu62
42,"Blueberry Faygo","Lil Mosey",1703977,https://open.spotify.com/track/22LAwLoDA5b4AaGSkg6bKW
43,"Break My Heart","Dua Lipa",1659688,https://open.spotify.com/track/017PF4Q3l4DBUiWoXk4OWT
44,"How You Like That",BLACKPINK,1657616,https://open.spotify.com/track/3vAn0qZzdyuHamcrpkfiX3
45,"Djadja (feat. Maluma) - Remix","Aya Nakamura",1649228,https://open.spotify.com/track/6AzKhCHOms83jvNVLsz0Bt
46,"The Woo (feat. 50 Cent & Roddy Ricch)","Pop Smoke",1645901,https://open.spotify.com/track/1H7KnK26kc1YyellpbINEn
47,"Over Now (with The Weeknd)","Calvin Harris",1638255,https://open.spotify.com/track/58AGoOGbwsQMhBbH0eFLRR
48,MAMACITA,"Black Eyed Peas",1624246,https://open.spotify.com/track/24IgCW19L8lXKyFZwzFtD3
49,"Kings & Queens","Ava Max",1613689,https://open.spotify.com/track/76nqCfJOcFFWBJN32PAksn
50,"ily (i love you baby) (feat. Emilee)","Surf Mesa",1579621,https://open.spotify.com/track/62aP9fBQKYKxi7PDXwcUAS
51,"Take You Dancing","Jason Derulo",1548668,https://open.spotify.com/track/59qrUpoplZxbIZxk6X0Bm3
52,"Stuck with U (with Justin Bieber)","Ariana Grande",1539244,https://open.spotify.com/track/4HBZA5flZLE435QTztThqH
53,"Mamichula - con Nicki Nicole",Trueno,1494066,https://open.spotify.com/track/4pXW6ZAHBz7ODXTRKklWrM
54,"Toosie Slide",Drake,1460225,https://open.spotify.com/track/466cKvZn1j45IpxDdYZqdA
55,"Ayer Me Llamó Mi Ex (feat. Lenny Santos)",KHEA,1458424,https://open.spotify.com/track/6C6mUonH6MNdSg5pw7kOc9
56,"Still Don't Know My Name",Labrinth,1434763,https://open.spotify.com/track/6N22FZs2ZhPBYi3b9XPajV
57,"Relación - Remix",Sech,1425104,https://open.spotify.com/track/35UUpTmrcFXNIVIN26ujXl
58,Circles,"Post Malone",1418454,https://open.spotify.com/track/21jGcNKet2qwijlDFuPiPb
59,"Lithuania (feat. Travis Scott)","Big Sean",1399184,https://open.spotify.com/track/4VLTxHOyFX5FRtkpsFm5Pc
60,"Party Girl",StaySolidRocky,1396612,https://open.spotify.com/track/3IJYUaN3tx04S4TYyZHKoP
61,"The Box","Roddy Ricch",1389116,https://open.spotify.com/track/0nbXyq5TXYPCO7pr3N8S4I
62,"Adore You","Harry Styles",1366826,https://open.spotify.com/track/3jjujdWJ72nww5eGnfs2E7
63,"Del Mar",Ozuna,1336299,https://open.spotify.com/track/5cpJFiNwYyWwFLH0V6B3N8
64,"my ex's best friend (with blackbear)","Machine Gun Kelly",1321043,https://open.spotify.com/track/70rFIfYN7lU6iTgUIVP42w
65,goosebumps,"Travis Scott",1308688,https://open.spotify.com/track/6gBFPUFcJLzWGx4lenP6h2
66,"Mi Cuarto","Jerry Di",1293602,https://open.spotify.com/track/6fmQjRuo7XvRFCK2qex5hQ
67,Tusa,"KAROL G",1267171,https://open.spotify.com/track/7k4t7uLgtOxPwTpFmtJNTY
68,"Lucid Dreams","Juice WRLD",1265908,https://open.spotify.com/track/285pBltuF7vW8TeWk8hdRR
69,Señorita,"Shawn Mendes",1248963,https://open.spotify.com/track/6v3KW9xbzN5yKLt9YKDYA2
70,"Sunflower - Spider-Man: Into the Spider-Verse","Post Malone",1241370,https://open.spotify.com/track/0RiRZpuVRbi7oqRdSMwhQY
71,Memories,"Maroon 5",1236247,https://open.spotify.com/track/2b8fOow8UzyDFAE27YhOZM
72,"Electric Love",BØRNS,1234402,https://open.spotify.com/track/2GiJYvgVaD2HtM8GqD9EgQ
73,"Tap In (feat. Post Malone, DaBaby & Jack Harlow)",Saweetie,1227983,https://open.spotify.com/track/5woaU1FNkqCwg6WzWiQPW5
74,Falling,"Trevor Daniel",1227548,https://open.spotify.com/track/2rRJrJEo19S2J82BDsQ3F7
75,"Wolves (feat. Post Malone)","Big Sean",1207404,https://open.spotify.com/track/33gwZOGJWEZ7dRWPqPxBEZ
76,Robbery,"Juice WRLD",1203238,https://open.spotify.com/track/6Hj9jySrnFppAI0sEMCZpJ
77,"LOCKED UP PT. 2",6ix9ine,1203193,https://open.spotify.com/track/7Mu3sCvXdMSlBLrUPOhWAG
78,"In Your Eyes","The Weeknd",1195690,https://open.spotify.com/track/7szuecWAPwGoV1e5vGu8tl
79,"Luckst mich nur ab","Bonez MC",1180903,https://open.spotify.com/track/4iD5KYizD5e0KrCsk58P2r
80,"bad guy","Billie Eilish",1167532,https://open.spotify.com/track/2Fxmhks0bxGSBdJ92vM42m
81,"HIGHEST IN THE ROOM","Travis Scott",1159302,https://open.spotify.com/track/3eekarcy7kvN4yt5ZFzltW
82,"TKN (feat. Travis Scott)",ROSALÍA,1155433,https://open.spotify.com/track/4w47S36wQGBhGg073q3nt7
83,cardigan,"Taylor Swift",1149318,https://open.spotify.com/track/4R2kfaDFhslZEMJqAFNpdd
84,"Be Kind (with Halsey)",Marshmello,1141339,https://open.spotify.com/track/3Z8FwOEN59mRMxDCtb8N0A
85,"Intentions (feat. Quavo)","Justin Bieber",1132409,https://open.spotify.com/track/4umIPjkehX1r7uhmGvXiSV
86,"Lean (feat. Towy, Osquel, Beltito & Sammy & Falsetto)","Super Yei",1125084,https://open.spotify.com/track/5DoLhdU27owX1NMrKLUbUl
87,Dior,"Pop Smoke",1118634,https://open.spotify.com/track/79s5XnCN4TJKTVMSmOx8Ep
88,GOOBA,6ix9ine,1117260,https://open.spotify.com/track/6qiiDtFAJjyEhoZVcf6ovL
89,"Hasta Que Dios Diga","Anuel AA",1111011,https://open.spotify.com/track/06s3QtMJVXw1AJX3UfvZG1
90,"Caramelo - Remix",Ozuna,1108492,https://open.spotify.com/track/67jvGGbJmOmVonlyX3mNkV
91,"Ride It",Regard,1091496,https://open.spotify.com/track/2tnVG71enUj33Ic2nFN6kZ
92,"Stunnin' (feat. Harm Franklin)","Curtis Waters",1086266,https://open.spotify.com/track/2D0dj3hVkRQJCp63cxCPEx
93,"my future","Billie Eilish",1085850,https://open.spotify.com/track/2ygvZOXrIeVL4xZmAWJT2C
94,Shallow,"Lady Gaga",1062723,https://open.spotify.com/track/2VxeLyX666F8uXCJ0dZF8B
95,"SICKO MODE","Travis Scott",1058842,https://open.spotify.com/track/2xLMifQCjDGFmkHkpNLD9h
96,"Bande organisée",Jul,1051828,https://open.spotify.com/track/205HNJ73cgpC0LAOnuQiWT
97,Favorito,Camilo,1049529,https://open.spotify.com/track/0jT8Nl0shPS8115is0wD2Q
98,"lovely (with Khalid)","Billie Eilish",1046893,https://open.spotify.com/track/0u2P5u6lvoDfwTYjAADbn4
99,Secrets,Regard,1042270,https://open.spotify.com/track/66W1rVTnEv86dIkFhoiElg
100,"Life Is Good (feat. Drake)",Future,1036381,https://open.spotify.com/track/1K5KBOgreBi5fkEHvg5ap3
101,ROXANNE,"Arizona Zervas",1035836,https://open.spotify.com/track/696DnlkuDOXcMAnKlTgXXK
102,"Got It On Me","Pop Smoke",1029719,https://open.spotify.com/track/25zlnOAzbVoOzIeXSvQFf1
103,"Say So","Doja Cat",1022624,https://open.spotify.com/track/3Dv1eDb0MEgF93GpLXlucZ
104,"PORFA Remix ( Feat. Maluma, Nicky Jam, Sech) - Remix",Feid,1019804,https://open.spotify.com/track/7lUdbnz7wsv3C9zzf4WHl9
105,"Be Like That - feat. Swae Lee & Khalid","Kane Brown",1016766,https://open.spotify.com/track/5f1joOtoMeyppIcJGZQvqJ
106,"Blastoff (feat. Juice Wrld & Trippie Redd)","Internet Money",1012133,https://open.spotify.com/track/2rFsFjq0D9JAmc0APpCO6P
107,"THE SCOTTS","THE SCOTTS",1007164,https://open.spotify.com/track/39Yp9wwQiSRIDOvrVg7mbk
108,"If the World Was Ending - feat. Julia Michaels","JP Saxe",985385,https://open.spotify.com/track/2kJwzbxV2ppxnQoYw4GLBZ
109,Azul,"J Balvin",981433,https://open.spotify.com/track/2lCkncy6bIB0LTMT7kvrD1
110,Sálvame,RBD,973935,https://open.spotify.com/track/3hbTkJ0yFzHbawnKyhvTQj
111,"Sunday Best",Surfaces,973049,https://open.spotify.com/track/1Cv1YLb4q0RzL6pybtaMLo
112,"Lets Link",WhoHeem,971958,https://open.spotify.com/track/0wYOlCybpxFc2azWLyYj0S
113,Believer,"Imagine Dragons",970383,https://open.spotify.com/track/0pqnGHJpmpxLKifKRmU6WP
114,Supalonely,BENEE,958283,https://open.spotify.com/track/4nK5YrxbMGZstTLbvj6Gxw
115,"everything i wanted","Billie Eilish",949668,https://open.spotify.com/track/3ZCTVFBt2Brf31RLEnCkWJ
116,"Oh Juliana",Niack,944739,https://open.spotify.com/track/4xWzZmX4K1yyrdtRfbUvjt
117,Games,Ufo361,943078,https://open.spotify.com/track/3P4uSN2VJ7asF4xdw1lDEf
118,Falling,"Harry Styles",928529,https://open.spotify.com/track/1ZMiCix7XSAbfAJlEZWMCp
119,"Obey (with YUNGBLUD)","Bring Me The Horizon",923463,https://open.spotify.com/track/7fQox8Ere1HDm0jhSnsFHu
120,"Tap In",Saweetie,919812,https://open.spotify.com/track/4Hpib09wXgD84w4uwTPnYD
121,"Parce (feat. Justin Quiles)",Maluma,916993,https://open.spotify.com/track/4RJz8NfIe09gpKMiRUWKhJ
122,Rojo,"J Balvin",915645,https://open.spotify.com/track/380HmhwTE2NJgawn1NwkXi
123,"Elegí (feat. Dímelo Flow)","Rauw Alejandro",908376,https://open.spotify.com/track/50ZC4PM7hywH27RcCfViau
124,"Solo Quédate En Silencio",RBD,906122,https://open.spotify.com/track/2RJ1fg4qf2vgZKifTa4HgA
125,"Deep Reverence (feat. Nipsey Hussle)","Big Sean",904563,https://open.spotify.com/track/2CDcXWYWilHTXrsOXJza8n
126,"exile (feat. Bon Iver)","Taylor Swift",903755,https://open.spotify.com/track/4pvb0WLRcMtbPGmtejJJ6y
127,"Godzilla (feat. Juice WRLD)",Eminem,887674,https://open.spotify.com/track/7FIWs0pqAYbP91WWM0vlTQ
128,"Yo Perreo Sola","Bad Bunny",885476,https://open.spotify.com/track/0SqqAgdovOE24BzxIClpjw
129,"Enemigos Ocultos",Ozuna,883187,https://open.spotify.com/track/3fhOpwaKobrELFjKLcXHgI
130,Rebelde,RBD,882187,https://open.spotify.com/track/56tOMi4N980gmsdUoyaLb3
131,"After Party","Don Toliver",876643,https://open.spotify.com/track/527k23H0A4Q0UJN3vGs0Da
132,"I Don't Care (with Justin Bieber)","Ed Sheeran",874242,https://open.spotify.com/track/0hVXuCcriWRGvwMV1r5Yn9
133,"Why Would I Stop?","Big Sean",873872,https://open.spotify.com/track/46hDiH4YvAWXE04GskkIHS
134,"Tak Tiki Tak","Harry Nach",872307,https://open.spotify.com/track/7gwwt1IaAWwmB7af0AcuBM
135,"hot girl bummer",blackbear,863609,https://open.spotify.com/track/2mt1IqcFyY1zmYZT8Q3xw9
136,"Play Date","Melanie Martinez",854668,https://open.spotify.com/track/4DpNNXFMMxQEKl7r0ykkWA
137,"rockstar (feat. 21 Savage)","Post Malone",853320,https://open.spotify.com/track/0e7ipj03S05BNilyu5bRzt
138,"Nuestro Amor",RBD,845060,https://open.spotify.com/track/7F7qwp7VZRVwZsNoddRRgX
139,Safaera,"Bad Bunny",844866,https://open.spotify.com/track/2DEZmgHKAvm41k4J3R2E9Y
140,"All Girls Are The Same","Juice WRLD",842930,https://open.spotify.com/track/4VXIryQMWpIdGgYR4TrjT1
141,"WHATS POPPIN","Jack Harlow",842800,https://open.spotify.com/track/1jaTQ3nqY3oAAYyCTbIvnM
142,"feel something","Bea Miller",840716,https://open.spotify.com/track/7JDWhC422Gtk1Bq0mL3OTC
143,"Jocelyn Flores",XXXTENTACION,839698,https://open.spotify.com/track/7m9OqQk4RVRkw9JJdeAw96
144,"7 rings","Ariana Grande",837590,https://open.spotify.com/track/6ocbgoVGwYJhOv1GgI9NsF
145,"Harder Than My Demons","Big Sean",830878,https://open.spotify.com/track/23XTYrwfHXY8H1PuQYJbDA
146,"Shape of You","Ed Sheeran",830099,https://open.spotify.com/track/7qiZfU4dY1lWllzX7mPBI3
147,"Bohemian Rhapsody - 2011 Mix",Queen,827821,https://open.spotify.com/track/4u7EnebtmKWzUH433cf5Qv
148,"CÓMO SE SIENTE - Remix","Jhay Cortez",823722,https://open.spotify.com/track/2tFwfmceQa1Y6nRPhYbEtC
149,"Money Trees","Kendrick Lamar",823006,https://open.spotify.com/track/2HbKqm4o0w5wEeEFXm2sD4
150,Perfect,"Ed Sheeran",822601,https://open.spotify.com/track/0tgVpDi06FyKpA1z0VMD4v
151,"Lose Somebody",Kygo,821780,https://open.spotify.com/track/1sgDyuLooyvEML4oHspNza
152,"Say You Won't Let Go","James Arthur",821400,https://open.spotify.com/track/5uCax9HTNlzGybIStD3vDh
153,"Some Say - Felix Jaehn Remix",Nea,820932,https://open.spotify.com/track/7C1trmcQQ5n5RNy4l6ziCv
154,"Savage Remix (feat. Beyoncé)","Megan Thee Stallion",818430,https://open.spotify.com/track/5v4GgrXPMghOnBBLmveLac
155,"The Plan - From the Motion Picture ""TENET""","Travis Scott",817647,https://open.spotify.com/track/551xyaSJsg8hILXFq9JdST
156,Madrid,Maluma,817054,https://open.spotify.com/track/19OXtYzrJyCrQvTbfukt4H
157,"Are You Bored Yet? (feat. Clairo)",Wallows,814390,https://open.spotify.com/track/57RA3JGafJm5zRtKJiKPIm
158,"Lose Control",MEDUZA,813724,https://open.spotify.com/track/7CHi4DtfK4heMlQaudCuHK
159,"THE BADDEST",K/DA,813672,https://open.spotify.com/track/2V4Fx72svQRxrFvNT1eq5f
160,"Chicago Freestyle (feat. Giveon)",Drake,812854,https://open.spotify.com/track/4wVOKKEHUJxHCFFNUWDn0B
161,"Ser O Parecer",RBD,812531,https://open.spotify.com/track/5sgvzXoYFCr5F5tUZdAA20
162,"Hate The Other Side (with Marshmello & The Kid Laroi)","Juice WRLD",811554,https://open.spotify.com/track/0ada5XsQGLPUVbmTCkAP49
163,Righteous,"Juice WRLD",806819,https://open.spotify.com/track/5dOxHHMOFAbG3VH23t0xNm
164,"Nobody's Love","Maroon 5",804942,https://open.spotify.com/track/3kwgqoBqTwoAH4nT29TYrq
165,"Mad at Disney","salem ilese",801958,https://open.spotify.com/track/7aGyRfJWtLqgJaZoG9lJhE
166,Jeans,"Justin Quiles",800981,https://open.spotify.com/track/3GtnId3Cm1Xa6joCj08nzW
167,Conversations,"Juice WRLD",799202,https://open.spotify.com/track/4K06PO78fW4mnBVenxGNob
168,SAD!,XXXTENTACION,795687,https://open.spotify.com/track/3ee8Jmje8o58CHK66QrVC2
169,"DOLLAZ ON MY HEAD (feat. Young Thug)",Gunna,795567,https://open.spotify.com/track/3nS9a01VvXHQriLqJYwRqG
170,"El Mismo Aire - con Pablo Alborán",Camilo,786484,https://open.spotify.com/track/5EbtodsuLbxrFDH6j5avVS
171,"When I Look At You","Miley Cyrus",784865,https://open.spotify.com/track/6ZfXA2xakAvphXOSOJ3u1W
172,"Not Shy",ITZY,778620,https://open.spotify.com/track/4ecVWqbtW6phQGpZMAyqIU
173,Despeinada,Ozuna,777138,https://open.spotify.com/track/0JAZWvvqttGFm4UMDsPQXC
174,TUTU,6ix9ine,776296,https://open.spotify.com/track/4We7QlOUIwpt5w8y07Gd0M
175,"Beautiful People (feat. Khalid)","Ed Sheeran",775403,https://open.spotify.com/track/70eFcWOvlMObDhURTqT4Fv
176,"Quiéreme Mientras Se Pueda","Manuel Turizo",774638,https://open.spotify.com/track/34LI7rwi9H8w2S5KTHnv1M
177,ZTFO,"Big Sean",772810,https://open.spotify.com/track/0z36JaXXoFXuPuQucKEsdx
178,"No Guidance (feat. Drake)","Chris Brown",772089,https://open.spotify.com/track/6XHVuErjQ4XNm6nDPVCxVX
179,Unterwegs,KitschKrieg,768014,https://open.spotify.com/track/7mrWTjhYctgEQb0lJKrVWy
180,Alane,"Robin Schulz",763211,https://open.spotify.com/track/2u6Jm2klS4yvAlbSHlxUwI
181,Physical,"Dua Lipa",758423,https://open.spotify.com/track/3AzjcOeAmA57TIOr9zF1ZW
182,"GO (feat. Juice WRLD)","The Kid LAROI",753173,https://open.spotify.com/track/2rPHUAeUPbNgTmK18FPTiZ
183,"when the party's over","Billie Eilish",753062,https://open.spotify.com/track/43zdsphuZLzwA9k4DJhU0I
184,21,"Polo G",752752,https://open.spotify.com/track/3JKgcAa7r07ocVWcV8bS0H
185,"Un Poco De Tu Amor",RBD,749396,https://open.spotify.com/track/64mK5Yd0rdGeXVkMFspEyt
186,"What's Love Got to Do with It",Kygo,746540,https://open.spotify.com/track/3Be7CLdHZpyzsVijme39cW
187,"Sweet & Sour (feat. Lauv & Tyga)","Jawsh 685",746130,https://open.spotify.com/track/3ZWhRS2EJVL5B0IEzkcvZa
188,ADMV,Maluma,746118,https://open.spotify.com/track/4j3iq13kHs5PB94jdTp3Y3
189,"Someone To You",BANNERS,746018,https://open.spotify.com/track/2f0pn9DkEJwAzXApnFh5cr
190,"Martin & Gina","Polo G",743251,https://open.spotify.com/track/1VLtjHwRWOVJiE5Py7JxoQ
191,"Boss Bitch","Doja Cat",741007,https://open.spotify.com/track/78qd8dvwea0Gosb6Fe6j3k
192,Enséñame,RBD,737990,https://open.spotify.com/track/3eo3Dw5OGSWCzJDVHLKE3v
193,"Este Corazón",RBD,737225,https://open.spotify.com/track/0bMVCO35RJiUhAfvFsLjIF
194,"All of Me","John Legend",736829,https://open.spotify.com/track/3U4isOIWM3VvDubwSI3y7a
195,"Aún Hay Algo",RBD,735311,https://open.spotify.com/track/6fqpsCQ7jF7OgQolXgYovX
196,Happier,Marshmello,731354,https://open.spotify.com/track/2dpaYNEQHiRxtZbfNsse99
197,"Investe Em Mim","Jonas Esticado",730366,https://open.spotify.com/track/15k1TDabqSEmyXOwMq9RM7
198,"7 Summers","Morgan Wallen",730233,https://open.spotify.com/track/0Z0kNthq0sS4lvGz9SSlBF
199,Jangueo,"Alex Rose",729271,https://open.spotify.com/track/1bRpSCFv6P2OUhciByeRYR
200,"Ain't It Different (feat. AJ Tracey & Stormzy)","Headie One",727239,https://open.spotify.com/track/6NJfIydBMYrXvlaXsFxmc8

output

5 <terminated > SongsReport [Java Application] C:\Program Files\Java\jdk1.8.0_121\jre Total song loaded : 200 Total unique ar

If you have any Queries please comment here.
If you like my answer Please Upvote / Like it.
thank you

Add a comment
Know the answer?
Add Answer to:
Use the csv file on spotify from any date Code from lab2 import java.io.File; import java.io.FileNotFoundException;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java code to read from .csv file i currently have a .csv file that looks like...

    Java code to read from .csv file i currently have a .csv file that looks like this: 39.743222, -105.006241, Hospital 39.743981, -105.020017, Home 39.739377, -104.984774, Firehouse 39.627779, -104.839291, McDonald's 39.731919, -104.961814, Chipotle I need to write code to extract the doubles from each line to use for my Linked List. this is what i have so far: Scanner in = new Scanner(new FileInputStream(DATA_FILE));

  • import java.io.*; import java.util.Scanner; public class CrimeStats { private static final String INPUT_FILE = "seattle-crime-stats-by-1990-census-tract-1996-2007.csv"; private...

    import java.io.*; import java.util.Scanner; public class CrimeStats { private static final String INPUT_FILE = "seattle-crime-stats-by-1990-census-tract-1996-2007.csv"; private static final String OUTPUT_FILE = "crimes.txt"; public static void main(String[] args) { int totalCrimes = 0; // read all the rows from the csv file and add the total count in the totalCrimes variable try { Scanner fileScanner = new Scanner(new File(INPUT_FILE)); String line = fileScanner.nextLine(); // skip first line while (fileScanner.hasNext()) { String[] tokens = fileScanner.nextLine().split(","); if (tokens.length == 4) { totalCrimes +=...

  • Information About This Project             In the realm of database processing, a flat file is a...

    Information About This Project             In the realm of database processing, a flat file is a text file that holds a table of records.             Here is the data file that is used in this project. The data is converted to comma    separated values ( CSV ) to allow easy reading into an array.                         Table: Consultants ID LName Fee Specialty 101 Roberts 3500 Media 102 Peters 2700 Accounting 103 Paul 1600 Media 104 Michael 2300 Web Design...

  • JAVA Code: Complete the program that reads from a text file and counts the occurrence of...

    JAVA Code: Complete the program that reads from a text file and counts the occurrence of each letter of the English alphabet. The given code already opens a specified text file and reads in the text one line at a time to a temporary String. Your task is to go through that String and count the occurrence of the letters and then print out the final tally of each letter (i.e., how many 'a's?, how many 'b's?, etc.) You can...

  • complete this in java import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class...

    complete this in java import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class WordDetective { /** * Finds the specified set of words in the specified file and returns them * as an ArrayList. This finds the specified set in the file which is on the * line number of the set. The first line and set in the file is 1. * * This returns an ArrayList with the keyword first, then : and then followed...

  • import java.util.Scanner; // TASK #1 Add the file I/O import statement here /** This class reads...

    import java.util.Scanner; // TASK #1 Add the file I/O import statement here /** This class reads numbers from a file, calculates the mean and standard deviation, and writes the results to a file. */ public class StatsDemo { // TASK #1 Add the throws clause public static void main(String[] args) { double sum = 0; // The sum of the numbers int count = 0; // The number of numbers added double mean = 0; // The average of the...

  • Complete the code: package hw4; import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.Scanner; /* * This...

    Complete the code: package hw4; import java.io.File; import java.io.IOException; import java.util.LinkedList; import java.util.Scanner; /* * This class is used by: * 1. FindSpacing.java * 2. FindSpacingDriver.java * 3. WordGame.java * 4. WordGameDriver.java */ public class WordGameHelperClass { /* * Returns true if an only the string s * is equal to one of the strings in dict. * Assumes dict is in alphabetical order. */ public static boolean inDictionary(String [] dict, String s) { // TODO Implement using binary search...

  • Get doubles from input file. Output the biggest. Answer the comments throughout the code. import java.io.File;...

    Get doubles from input file. Output the biggest. Answer the comments throughout the code. import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Lab8Num1 { public static void main(String[] args) { //Declaring variable to be used for storing and for output double biggest,temp; //Creating file to read numbers File inFile = new File("lab8.txt"); //Stream to read data from file Scanner fileInput = null; try { fileInput = new Scanner(inFile); } catch (FileNotFoundException ex) { //Logger.getLogger(Lab10.class.getName()).log(Level.SEVERE, null, ex); } //get first number...

  • composed the following java code to read a string from a text file but receiving compiling...

    composed the following java code to read a string from a text file but receiving compiling errors. The text file is MyNumData.txt. Included the original java script that generated the output file. Shown also in the required output results after running the java program. I can't seem to search for the string and output the results. Any assistance will be greatly appreciated. import java.io.BufferedReader; import java.io.FileReader; import java.util.ArrayList; public class Main {   public static void main(String[] args) {     System.out.print("Enter the...

  • Trying to practice this assignment Argument list: the *yahoonews.txt Data file: yahoonews.txt Wr...

    Trying to practice this assignment Argument list: the *yahoonews.txt Data file: yahoonews.txt Write a program named WordCount.java, in this program, implement two static methods as specified below: public static int countWord(Sting word, String str) this method counts the number of occurrence of the word in the String (str) public static int countWord(String word, File file) This method counts the number of occurrence of the word in the file. Ignore case in the word. Possible punctuation and symbals in the file...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT