I am trying to add some headers to a txt file. Actually i have found a script already but I want to edit a part of it. Script (you can also find it here if you like: https://ucdavis-bioinformatics-training.github.io/2017-June-RNA-Seq-Workshop/thursday/counts.html):
for x in 03-alignment/*/*ReadsPerGene.out.tab; do \
s=`basename $x | cut -f1 -d_`
echo $s
done | paste -s > header.txt
The thing is that I want to "paste -s" but not starting from the first column but from the second. I thought done | awk $2 | paste -s | header.txt could help but is doesnt.
Any ideas how to add the headers starting directly from the 2nd column, please?
So using the script above I take this output.
L004_AQAU-19 L004_AQAU-20 L004_AQAU-21 etc.
ALOMY0G001 0 0
ALOMY0G002 0 10
ALOMY0G003 20 15
ALOMY0G004 4 5 etc.
But i want to take the
L004_AQAU-19 L004_AQAU-20 etc.
ALOMY0G001 0 0
ALOMY0G002 0 10
ALOMY0G003 20 15
ALOMY0G004 4 5
etc.