generated from aigora/starter-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleerFichero.h
55 lines (37 loc) · 1.57 KB
/
leerFichero.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//ESTRUCTURAS NECESARIAS
typedef struct {
int month;
int year;
} fecha;
typedef struct {
char nombre_fuente[50];
double valor_mes[12];
//si el valor se elimino el vector tendra un valor de 1 para el mes, si no tendra un valor 0 para uno no eliminado
int eliminado[12];
//si el valor se usa para calculos este tendra el valor de 1, si NO se usa para calculos tendra valor 0
int calculable[12];
} energia;
typedef struct {
fecha date[12];
energia data[18];
} datos;
//Estructuras para la lectura de calculos
typedef struct{
char dato_calculo[18][100];
char nombre_calculo[50];
}tipo_calculo;
typedef struct{
tipo_calculo dato[8];
}resultado;
//FUNCIONES NECESARIAS
void numeroColumnas(char filas[], int *numDatos);
void compilarFechas(char fila[], datos memoria[]);
void numeroYears(datos GWh[], int *numYear);
void leerTitulo(char fila[], datos memoria[], int numYear, int numFuente);
void compilarDatos(char fila[], datos memoria[], int numYear, int numFuentes, int meses[]);
void Imprimir_tabla(datos GWh[], int numYear, int num_mes_por_year[]);
void hacer_copia_seguridad(char filas[][10000], int numYear, int num_mes_por_year[], datos GWh[]);
void escoger_fichero_salida(char filas[][10000], int numYear, int num_mes_por_year[], datos GWh[]);
void guardar_datos(char filas[][10000], int numYear, int num_mes_por_year[], datos GWh[]);
void eliminar_dato(datos GWh[], int numYear, int num_mes_por_year[]);
void ingresar_editar_dato(datos GWh[], int numYear, int num_mes_por_year[]);