Question: My question is how do I parse through my CSV file and extract only the song title which is within the third set of quotes,




My question is how do I parse through my CSV file and extract only the song title which is within the third set of quotes, for example in the top part, " t " is the song title and I would like to place that string value into str2 so that it compares the song title they are looking for with the song title in the list and then a check statement that then prints more than one song title if there are more with that same title, then I need to have the function of being able to edit the contents of that line like artist name, song title, album name, basically every entry there is.
So to sum up, I need an edit function that searches the csv file for the matching song title and then when the song title is found, it allows the user to change any information within the node and then update it to the csv file. IN C PROGRAMMING LANGUAGE
Node* Editplaylist(Node* plist) FILE* infile = fopen("musicPlayList.csv", "r"); char line[100] = ""; char str1[20]; printf("Enter song title: "); scanf("%s", stri); strcmp(tolower(str1), tolower(str2)); fclose(infile); 19 Qint main Node* playlist = NULL; int choice = 0; while (choice != 3) printf(" 1. Load"); // Takes info from csv and parses file into structs & doubly linked list printf(" 2. Store"); // writes the csv file to the csv file in opposite order printf(" 3. Display"); // prints the listodes to display screen printf(" 4. Insert"); // inserts items in list printf(" 6. edit"); // edits information in the list printf(" 8. rate"); // rates the song printf(" 9. play"); // prints the selected song, prints each song in order from current song printf(" 11. exit"); 11 Exit feature, ends program printf(" Enter Menu option: "); scanf("%d", &choice); switch (choice) case 1: playlist = Loadplaylist(); DisplayList(playlist); break; case 2: storeplaylist(playlist); system("cls"); break; case 3: DisplayList(playlist); break; // insert an item into the list case 4: playlist = InsertNew (playlist); DisplayList(playlist); storeplaylist(playlist); break; // // edit a specific item in the list case 6: playlist = Editplaylist(playlist); break; 1/ // edit rating in the list //case 8: // break; 1/ // play item in the list //case 9: 866868822 // break; case 11: exit(); break; } #ifndef DOUBLY_LINKED #define DOUBLY_LINKED #define _CRT_SECURE_NO_WARNINGS #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
