For many this will be very basic, but for me it's driving me nuts!

I have a tab-delimited header:
```
sampleA	sampleB	sampleC
```

Depending on the number of samples I have, I want to make a new header as such:

For 3 samples:
```
sampleA	sampleB	sampleC	output001	output002	output003
```

For 4 samples:
```
sampleA	sampleB	sampleC	sampleD output001	output002	output003 output004
```
and so on...

I can duplicate the initial header to get the correct number of columns:
`paste header header`

However, I want new column names.. and that's where I'm stuck.... 

Use `awk` and `NF`. You can use `printf` to pad 0s.

Example:

    echo -e "sampleA\tsampleB\tsampleC" | awk -F"\t" -vOFS="\t" '{printf($0"\t"); for(i=1;i<NF;i++) printf("output%03d\t",i); printf("output%03d",i)}'