I have a situation like this, but with much more columns and rows:
TAG WEIGHT SIRE DAM TAG WEIGHT SIRE DAM TAG WEIGHT SIRE
1 30 PETER LINDA 7 25 12 SHERRY 12 25 CHARLIE
2 32 JOHN DINDA 8 28 KIM TERE 26 34 JOSH
3 28 PETER PRINCESS 26 30 PETER BECK 27 30 PETER
4 25 JOSH FANTA 28 14 FREDDY LENNY NA 29.6 NA
5 26 SENIOR TINA 11 16 DANTON 45 NA NA NA
6 28 BILL FRIDA NA 22.6 NA NA NA NA NA
NA 28.16 NA NA NA NA NA NA NA NA NA
And I would like to separate in three files based on the name of the columns, like this:
File 1
TAG WEIGHT SIRE DAM
1 30 PETER LINDA
2 32 JOHN DINDA
3 28 PETER PRINCESS
4 25 JOSH FANTA
5 26 SENIOR TINA
6 28 BILL FRIDA
File 2
TAG WEIGHT SIRE DAM
7 25 12 SHERRY
8 28 KIM TERE
26 30 PETER BECK
28 14 FREDDY LENNY
11 16 DANTON 45
File 3
TAG WEIGHT SIRE DAM
12 25 CHARLIE NA
26 34 JOSH NA
27 30 PETER NA
So, there is the mean for the weight on the last row for each file, and this information is unnecessary, and some situation there are not all columns (File 3) and so I would like to insert the column name with NA
.