I have the following dataset with 171 files.
CHR:POS REF:ALT BREED
6:85406127 T:A 0.333333
6:85406128 T:C 0
6:85406129 C:G 0.333333
6:85406130 T:G 0.833333
Desired output is
CHR:POS REF:ALT BREED BREED2 BREED3 ... 171st file
6:85406127 T:A 0.333333 0.33 0.5 .... 0.4
6:85406128 T:C NA 0.33 0.5 .... 0.4
6:85406129 C:G 0.333333 0.33 NA .... 0
6:85406130 T:G 0.833333 0.33 0.5 .... NA
The filenames contain the breed names. The first and second columns contain the same information in every file. How I am going to extract only the third column from each file while keeping all columns from the first file?
I moved the first file into other folder to exclude from the extraction. The following command did not give the result.
cut -d " " -f3 *.txt | paste ../breedname.txt - > output.txt
I also had attempts using awk command shown in these questions, but it did not work for my dataset.
Any help is welcomed!