printing a 2D array :warning: excess elements in array initializer - arrays

I'm trying to print 8 rows and 5 columns in my output, but my code is throwing errors saying:
warning: excess elements in array initializer.
This is my code:
#include <stdio.h>
void main()
{
int rows,columns;
int array[8][5] =
{
{ 11, 12, 13, 14, 15 }, { 21, 22, 23, 24, 25 },
{ 31, 32, 33, 34, 35 }, { 41, 42, 43, 44, 45 },
{ 51, 52, 53, 54, 55 }, { 61, 62, 63, 64, 65 },
{ 71, 72, 73, 74, 75 }, { 81, 82, 83, 84, 85 },
};
for(columns=0;columns<=4;columns++)
{
for(rows=0;rows<=7;rows++)
{
printf("%d",array[rows][columns]);
}
printf("\n");
}
}
Can anyone please help me fix this code snippet?

You have:
int array[5][8]= {{11,12,13,14,15},{21,22,23,24,25},{31,32,33,34,35},{41,42,43,44,45},{51,52,53,54,55},{61,62,63,64,65},{71,72,73,74,75},{81,82,83,84,85}};
That declares an array of five sub-arrays with eight elements in each sub-array, but you try to initialize it with eight sub-arrays (with five elements in each), and that is why you get the error message about "excess elements". If there were only five sub-arrays with five elements in each, the last three elements in each sub-array would be zeroed.
Fortran does this differently from C. See Wikipedia on Row-major vs Column-major order.
You need to either use int array[8][5] = { … }; or you need to regroup your initializers into five groups of eight, not eight groups of five.
int array[8][5] =
{
{ 11, 12, 13, 14, 15 }, { 21, 22, 23, 24, 25 },
{ 31, 32, 33, 34, 35 }, { 41, 42, 43, 44, 45 },
{ 51, 52, 53, 54, 55 }, { 61, 62, 63, 64, 65 },
{ 71, 72, 73, 74, 75 }, { 81, 82, 83, 84, 85 },
};
Or:
int array[5][8] =
{
{ 11, 12, 13, 14, 15, 21, 22, 23, },
{ 24, 25, 31, 32, 33, 34, 35, 41, },
{ 42, 43, 44, 45, 51, 52, 53, 54, },
{ 55, 61, 62, 63, 64, 65, 71, 72, },
{ 73, 74, 75, 81, 82, 83, 84, 85, },
};
I want 8 rows and 5 columns. Every set of 5 elements should be printed in 8 separate rows.
So you need int array[8][5] — 8 rows with 5 elements in each row. In a 2D array in C, the first index is the row, the second is the column. That means the outer loop runs over rows, the inner loop runs over columns.
#include <stdio.h>
int main(void)
{
int array[8][5] =
{
{ 11, 12, 13, 14, 15 }, { 21, 22, 23, 24, 25 },
{ 31, 32, 33, 34, 35 }, { 41, 42, 43, 44, 45 },
{ 51, 52, 53, 54, 55 }, { 61, 62, 63, 64, 65 },
{ 71, 72, 73, 74, 75 }, { 81, 82, 83, 84, 85 },
};
for (int row = 0; row < 8; row++)
{
for (int col = 0; col < 5; col++)
printf(" %d", array[row][col]);
putchar('\n');
}
return 0;
}
Output:
11 12 13 14 15
21 22 23 24 25
31 32 33 34 35
41 42 43 44 45
51 52 53 54 55
61 62 63 64 65
71 72 73 74 75
81 82 83 84 85

Related

Project Euler problem 11 in C isnt providing any output

I have been trying to solve Project Euler problem 11. I have rechecked my code multiple times but still, after debugging, my program is not providing any answers
The question states that we need to find the greatest product possible of 4 consecutive numbers: either vertically, horizontally or diagonally of the matrix given in the code below:
Here is my code.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int matr[20][20] =
{
{8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8},
{49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0},
{81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65},
{52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91},
{22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80},
{24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50},
{32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70},
{67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21},
{24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72},
{21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95},
{78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92},
{16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57},
{86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58},
{19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40},
{4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66},
{88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69},
{4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36},
{20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16},
{20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54},
{1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48}
};
int horProduct=0, verProduct=0, diagright=0, diagleft=0;
int maxProduct = 0;
// horizontal product
for (int i = 0; i < 20; i++)
{
for(int j = 0; j < 17; j++)
{
horProduct = matr[i][j]*matr[i][j+1]*matr[i][j+2]*matr[i][j+3];
}
if(horProduct > maxProduct)
{
maxProduct = horProduct;
}
}
//vertical product
for (int j = 0; j < 20; j++)
{
for(int i = 0; i < 17; i++)
{
verProduct = matr[i][j]*matr[i+1][j]*matr[i+2][j]*matr[i+3][j];
}
if(verProduct > maxProduct)
{
maxProduct = verProduct;
}
}
//diagonal right
for (int i = 0; i < 17; i++)
{
for(int j = 0; j < 17; j++)
{
diagright = matr[i][j]*matr[i+1][j+1]*matr[i+2][j+2]*matr[i+3][j+3];
}
if(diagright > maxProduct)
{
maxProduct = diagright;
}
}
//diagonal left
for (int i = 19; i > 3; i--)
{
for(int j = 19; j > 3; j--)
{
diagleft = matr[i][j]*matr[i-1][j-1]*matr[i-2][j-2]*matr[i-3][j-3];
}
if(diagleft > maxProduct)
{
maxProduct = diagleft;
}
}
printf("final largest product: %d\n", maxProduct);
return 0;
}
kindly let me know what is going wrong here. Why isn't my program able to print any output?
I did a rookie mistake.
The comparison with maxProduct should be inside the second loop.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int matr[20][20] =
{
{8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8},
{49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0},
{81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65},
{52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91},
{22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80},
{24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50},
{32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70},
{67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21},
{24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72},
{21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95},
{78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92},
{16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57},
{86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58},
{19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40},
{4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66},
{88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69},
{4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36},
{20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16},
{20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54},
{1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48}
};
int horProduct=0, verProduct=0, diagright=0, diagleft=0;
int maxProduct = 0;
// horizontal product
for (int i = 0; i < 20; i++)
{
for(int j = 0; j < 17; j++)
{
horProduct = matr[i][j]*matr[i][j+1]*matr[i][j+2]*matr[i][j+3];
if(horProduct > maxProduct)
{
maxProduct = horProduct;
}
}
}
printf("hori: %d\n", maxProduct);
for (int j = 0; j < 20; j++)
{
for(int i = 0; i < 17; i++)
{
verProduct = matr[i][j]*matr[i+1][j]*matr[i+2][j]*matr[i+3][j];
if(verProduct > maxProduct)
{
maxProduct = verProduct;
}
}
}
printf("verti: %d\n", maxProduct);
//diagonal right
for (int i = 0; i < 17; i++)
{
for(int j = 0; j < 17; j++)
{
diagright = matr[i][j]*matr[i+1][j+1]*matr[i+2][j+2]*matr[i+3][j+3];
if(diagright > maxProduct)
{
maxProduct = diagright;
}
}
}
printf("diagright: %d\n", maxProduct);
//diagonal left
for (int i = 0; i < 20 ; i++)
{
for(int j = 0; j < 17; j++)
{
diagleft = matr[i][j]*matr[i+1][j+1]*matr[i+2][j+2]*matr[i+3][j+3];
if(diagleft > maxProduct)
{
maxProduct = diagleft;
}
}
}
printf("diagleft: %d\n", maxProduct);
return 0;
}

Split string to a 2-dimensional array in Scala

In Scala:
Is there a way to directly split a string that contains 72 numeric values separated by ; into a 2-dimensional array of 9 rows and 8 columns with those numeric values -in numeric data type-?
val input = List.tabulate(72)(_.toString).mkString(";")
input.split(";").map(_.toInt).grouped(9).toArray
transforms
0;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;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71
into
Array(
Array(0, 1, 2, 3, 4, 5, 6, 7, 8),
Array(9, 10, 11, 12, 13, 14, 15, 16, 17),
Array(18, 19, 20, 21, 22, 23, 24, 25, 26),
Array(27, 28, 29, 30, 31, 32, 33, 34, 35),
Array(36, 37, 38, 39, 40, 41, 42, 43, 44),
Array(45, 46, 47, 48, 49, 50, 51, 52, 53),
Array(54, 55, 56, 57, 58, 59, 60, 61, 62),
Array(63, 64, 65, 66, 67, 68, 69, 70, 71)
)
If you want to swap the dimensions of rows/columns, replace 9 by 8.
using Range and grouped functions
scala> val a = (0 to 71).map(_.toString).toArray.mkString(";")
a: String = 0;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;56;57;58;59;60;61;62;63;64;65;66;67;68;69;70;71
scala> a.split(";").map(_.toInt).sliding(9,9).toArray
res269: Array[Array[Int]] = Array(Array(0, 1, 2, 3, 4, 5, 6, 7, 8), Array(9, 10, 11, 12, 13, 14, 15, 16, 17), Array(18, 19, 20, 21, 22, 23, 24, 25, 26), Array(27, 28, 29, 30, 31, 32, 33, 34, 35), Array(36, 37, 38, 39, 40, 41, 42, 43, 44), Array(45, 46, 47, 48, 49, 50, 51, 52, 53), Array(54, 55, 56, 57, 58, 59, 60, 61, 62), Array(63, 64, 65, 66, 67, 68, 69, 70, 71))
scala>

How to print the next index of the same element in array

I'm writing a function that finds two identical elements in an array and then prints the value of their index. I can't seem to get the right second index. What's my problem?
code:
the function I'm troubled with called 'couplesSearch' and it returns its
value to 'printCouples'.line 139
#include <stdio.h>
#include <stdlib.h>
#define NUM_GUESTS 200
#define FALSE 0
#define TRUE 1
#define KIDS_AGE 12
float averageAge(int ages[], int size);
int meals(int guestAges[], int size);
int search(int guestAges[], int size);
void print(int condition);
int coupleSearch(int guestAges[], int size);
void printCouples(int size, int condition2, int ageFriend);
int main(void)
{
int guestAges[NUM_GUESTS] = {42, 108, 95, 101, 90, 5, 79, 79, 83, 105, 66, 66, 2, 28, 2, 12, 116, 63, 28, 37,
112, 85, 63, 34, 53, 23, 22, 117, 39, 96, 48, 7, 12, 19, 70, 113, 108, 20, 116,
55, 24, 52, 3, 94, 34, 105, 22, 32, 54, 29, 108, 45, 23, 118, 118, 20, 84, 22,
50, 59, 77, 36, 111, 43, 49, 107, 41, 63, 65, 89, 87, 46, 51, 10, 11, 111, 7, 22,
34, 69, 70, 24, 85, 35, 37, 81, 47, 57, 12, 29, 25, 40, 27, 44, 18, 59, 39, 43,
10, 102, 34, 36, 80, 19, 25, 91, 100, 27, 114, 67, 102, 66, 45, 113, 31, 70, 18,
94, 58, 73, 107, 91, 42, 37, 36, 48, 16, 95, 72, 53, 111, 71, 22, 5, 47, 71, 28,
72, 8, 58, 98, 48, 34, 64, 66, 30, 50, 39, 102, 109, 63, 107, 27, 71, 94, 9,
61, 72, 43, 96, 11, 120, 25, 18, 69, 4, 116, 82, 3, 111, 92, 117, 15, 101, 37, 22,
109, 40, 109, 5, 2, 55, 54, 80, 19, 99, 61, 69, 8, 108, 9, 14, 49, 44, 48, 22,
31, 18, 14, 35};
int size = 0;
printf("average is: %.2f\n", averageAge(guestAges,size));
printf("Number of kids 12 and under: %d\n" , meals(guestAges, size));
print(search(guestAges,size));
coupleSearch(guestAges,size);
/*printf("Two guests with age 16 at index %d and index %d");
printf("Youngest guest age: ");
printf("Oldest guest age: ");*/
return 0;
}
/*
Function will return average age of party guests
input: age array, number of guests
output: average age
*/
float averageAge(int guestAges[], int size)
{
float sum = 0;
float avg = 0;
for(size = 0; size < NUM_GUESTS; ++size)
{
sum += guestAges[size];
}
avg = sum / NUM_GUESTS;
return avg;
}
int meals(int guestAges[], int size)
{
int kids = 0;
for (size = 0; size < NUM_GUESTS; size++)
{
if (guestAges[size] == KIDS_AGE || guestAges[size] < KIDS_AGE)
{
kids++;
}
}
return kids;
}
int search(int guestAges[], int size)
{
int condition = 0;
int age = 0;
printf("Enter age to search: ");
scanf("%d", &age);
while (size < NUM_GUESTS && age != guestAges[size])
{
size++;
}
if (size < NUM_GUESTS)
{
condition = TRUE;
} else
{
condition = FALSE;
}
return condition;
}
void print(int condition)
{
if (condition == TRUE)
{
printf("Guest found!\n");
}
else if (condition == FALSE)
{
printf("No guest this age.\n");
}
}
int coupleSearch(int guestAges[], int size)
{
int condition2 = 0;
int ageFriend = 0;
printf("Enter age of guest looking for friend: ");
scanf("%d", &ageFriend);
while (size < NUM_GUESTS && ageFriend != guestAges[size])
{
size++;
}
if (size < NUM_GUESTS)
{
condition2 = TRUE;
} else {
condition2 = FALSE;
}
printCouples(size,condition2,ageFriend);
return condition2;
}
void printCouples(int size, int condition2, int ageFriend)
{
if (condition2 == TRUE)
{
printf("Two guest with age %d at index %d and index %d\n", ageFriend, size+1, size+2);
}
else if (condition2 == FALSE)
{
printf("No guest this age.\n");
}
}
Thanks.
Your test assumes that there are two entries in the age array. That is, the age of the guest looking for a friend is not unique and that the array has been sorted. The array that you pass in is not sorted by age. Thus, size+2 will not contain the same age as size+1.
First sort your age array and then search for the first and last entry of that age in the array.
If you do not want to sort the array, then you would have to test every entry in the array and keep track of matching indexes.
You also exit coupleSearch() as soon as you have found the first match. You need to search for the second match separately if you do not want to sort and search for first and last match.
Since you print size+1, then your printed answer is one based.
You only search for the first match. In other words - you never search for a couple.
Maybe you should try something like:
void printCouples(int size, int condition2, int ageFriend)
{
int j = size+1; // Start after the first match
int found = 0;
while (j < NUM_GUESTS )
{
if (ageFriend == guestAges[j])
{
found = 1;
printf("Two guest with age %d at index %d and index %d\n", ageFriend, size, j);
}
}
if (!found)
{
printf("No guest this age.\n");
}
}
Notice that condition2 isn't used anymore.

How to decrease counter in for loop?

I'm using the array shuffle function from here: http://iosdevelopertips.com/swift-code/swift-shuffle-array-type.html.
On this line:
for var index = array.count - 1; index > 0; index -= 1
in the code below
func shuffleArray<T>( arrayparam: Array<T>) -> Array<T>
{
var array = arrayparam
for var index = array.count - 1; index > 0; index -= 1
{
// Random int from 0 to index-1
let j = Int(arc4random_uniform(UInt32(index-1)))
// Swap two array elements
// Notice '&' required as swap uses 'inout' parameters
swap(&array[index], &array[j])
}
return array
}
Swift throws this warning:
C-style for statement is deprecated and will be removed in a future
version of Swift
There isn't any recommendation of what should be used here. Any ideas what should replace it?
take a look at http://bjmiller.me/post/137624096422/on-c-style-for-loops-removed-from-swift-3
only decrease by 1:
for i in (0...n).reverse() {
}
or
decrease by more steps:
for i in someNum.stride(through: 0, by: -2) {
}
More info: there are two versions for stride: through and to. Difference is <= and >= for through, while < and > for to, depending on what you need.
func shuffle<T>(array: Array<T>) -> Array<T> {
var result = array
for index in array.indices.reverse() {
// generate random swapIndex and add a where clause
// to make sure it is not equal to index before swaping
guard
case let swapIndex = Int(arc4random_uniform(UInt32(array.count - index))) + index
where index != swapIndex
else { continue }
swap(&result[index], &result[swapIndex])
}
return result
}
var arrInt = Array(1...100)
shuffle(arrInt) // [28, 19, 25, 53, 35, 60, 14, 62, 34, 15, 81, 50, 59, 40, 89, 30, 2, 54, 27, 9, 82, 21, 11, 67, 84, 75, 44, 97, 66, 83, 36, 20, 26, 1, 76, 77, 8, 13, 72, 65, 64, 80, 88, 29, 98, 37, 33, 70, 52, 93, 100, 31, 4, 95, 45, 49, 61, 71, 24, 16, 12, 99, 94, 86, 46, 69, 63, 22, 48, 58, 51, 18, 43, 87, 41, 6, 92, 10, 38, 23, 68, 85, 42, 32, 55, 78, 56, 79, 3, 47, 39, 57, 90, 17, 5, 73, 7, 91, 74, 96]
for var index = array.count - 1; index > 0; index -= 1
Use a reverse range. Form the range and reverse it:
for index in (1..<array.count).reverse
However, as discussed in my answer here, there's a nicer way; I provide a >>> operator so you can say
for index in array.count>>>1
why don't you try:
for var index = array.count - 1; index > 0; index =index-1 ;

Multiple JSONArray to Array or List

I have saved my JSONs in a database and I want to get specific objects from every entry.
I'll show it:
[
{
"Messungen":[
{
"car":"no Car choosed",
"g":0.2,
"time":"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]",
"max":66,
"secondText":"0 - 200 km\/h",
"speed":"[63, 61, 63, 62, 63, 64, 65, 65, 66, 66, 66, 64, 63, 63]",
"tosecond":"\/",
"to100":"\/",
"way":209,
"avg":63
}
]
},
{
"Messungen":[
{
"car":"no Car choosed",
"g":0.2,
"time":"[0, 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]",
"max":70,
"secondText":"0 - 200 km\/h",
"speed":"[59, 61, 61, 61, 62, 60, 61, 62, 61, 62, 63, 63, 64, 64, 63, 63, 64, 65, 65, 65, 65, 65, 66, 66, 67, 69, 69, 67, 67, 67, 67, 67, 68, 68, 69, 70, 70, 69, 69, 69, 69, 69, 68, 66, 66]",
"tosecond":"\/",
"to100":"\/",
"way":808,
"avg":65
}
]
}
]
I want to get the way and the car from the Array Messungen as a List or Array.
Is that possible or should I make two new entries in the database with these two types?
Thanks :)
Databases are designed to be good at managing many, many rows. Use the power of the database. Create a table called "Messung" and make each observation (car, g, way, u.s.w) a column in the table.

Resources