Hello, I have this program that reads and prints the csv file which is a list of students that goes in this format name, surname, ballot, age, email and prints the list like this:
name, surname, ballot, age, email
name, surname, ballot, age, email
name, surname, ballot, age, email
What I want is for you to print them like that without commas and with a jump
name last names ballot age email
name last names ballot age email
name last names ballot age email
this is the code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//1) Funcion Recuperar
void furec(){
char opbackin[100]={};
FILE*lista_alumnos;
lista_alumnos=fopen("lista_alumnos.csv","r");
system("cls"); //Windows
//system("clear"); //Linux
printf("Recuperar lista de alumnos del 1CV2\n\n");
if(lista_alumnos==NULL)
{
printf("Error al abrir el fichero\n");
}
else
{
while(!feof(lista_alumnos))
printf("%c",getc(lista_alumnos));
}
printf("\n\nMenu:\n\n1) regresar | 2) Salir (Presionar cualquier tecla)\n\n");
printf("Terminal> ");
scanf("%s",&opbackin);
//Regresa al programa inicial '1' o 'recuperar'
if(strcmp(opbackin,"regresar")==0) {
main();
}
else {
if(strcmp(opbackin,"1")==0) {
main();
}
}
return;
}
//Programa principal
int main(void) {
char opin[100]={};
system("cls"); //Windows
//system("clear"); //Linux
//Textos de inicio
printf("Lista de alumnos del grupo 1CV2\n\nIngresa una opcion (numero o texto):\n\n1) recuperar\n\n");
printf("Terminal> ");
scanf("%s",&opin);
//Recupera informacion de alumno ingresando '1' o 'recuperar'
if(strcmp(opin,"recuperar")==0) {
furec();
}
else {
if(strcmp(opin,"1")==0) {
furec();
}
}
return 0;
}
As you can see, just read the file, I do not know how to do it at least to remove the commas: /