I have a problem with data organization. I have data that looks like this:
ROW date names
1 1.1.2000 A
2 NA B
3 NA C
4 1.1.2000 X
5 NA Y
6 2.1.2000 Z
I want it to look like this:
ROW date name1 name2 name3 name4
1 1.1.2000 A B C NA
2 1.1.2000 X Y NA NA
3 2.1.2000 Z NA NA NA
Therefore, the code must check the "date" column, and when it finds the date, it stores the row number (ROW1). Then it checks the following lines of "date" -column and, if the value is "NA", the program saves its rowan berries (ROW y: x) until it finds the next date (the next date line is not saved). The code then moves on to the y: x rows in the name columns and moves their data to the new columns in ROW1. After that, the code performs the same process for the next date that it finds after the y: x lines.
ROW1 y: x , . , , , .
, , , , .