I have a bunch of files, I want to concatenate 5th column of these files, but I don't know the number of files that find will find so I don't know what numbers I should put after cut -f
file names 456Ecoli.bed, 568Ecoli.bed, ..... Each file has 6 columns
The command doesn't work at all, I just wrote it to give you some idea of what I need.
find -name '*Ecoli.bed' -exec paste {} > All_Ecoli.bed; | cut -f 5,11,17, ....
Each bed file is something like
chr1 102 203 gene1 0.05 +
chr1 300 403 gene2 0.6 +
Thank you, but I want the output to have one column for every file. Something like when we use
cut -f 5,11,17
Have you tried running either script? Create a few lines of model output and show us how it's different from what these scripts produce.
copy/pasted from here:https://www.linuxquestions.org/questions/linux-newbie-8/merge-columns-from-multiple-files-851336/. Please upvote the OP in that forum:
This would give you output in columns instead of rows.
Works like a charm, could you help me to add the title of each file above each column?