I am trying to add a header to following file.txt file
20481 20481 2 1
20483 20483 1 2
20488 20488 2 2
20492 20492 1 2
20493 20493 1 1
20498 20498 2 1
I have tried using awk 'NR == 1 { $0 = "FID IID SEX LUNG_CANCER" }; 1' file.txt > hdr.txt
But it actually replaced the first line which is not correct. Where i am doing wrong.
FID IID SEX LUNG_CANCER
20483 20483 1 2
20488 20488 2 2
20492 20492 1 2
20493 20493 1 1
20498 20498 2 1
20500 20500 2 2