Hi, I have a table with <tab> separated columns, and I would like to separate it into individual columns keeping the name of the column and the name of the rows
I have tried in command line linux with cut
cat table.txt | cut -f1 -d\t
But it does not work, I have also tried with split in R
separate(data = table ,col = "a",into = "a", sep = "\t")
this is a sample of the table
a b c d e f g
Organism_1 1 1 1 1 1 1 1
Organism_2 1 1 1 1 1 1 1
Organism_3 1 1 1 1 1 0 1
Organism_4 1 1 1 1 1 1 1
Organism_5 1 1 1 1 1 1 1
Organism_6 1 1 1 1 1 1 1
Organism_7 1 1 1 1 1 1 1
Organism_8 1 1 1 1 1 1 1
Organism_9 1 1 1 1 1 0 1
Organism_10 0 1 1 1 1 1 1
Organism_11 1 1 1 1 1 1 1
Organism_12 1 1 1 1 1 1 1
Organism_13 1 1 1 1 1 1 1
Organism_14 1 0 1 1 1 1 1
Organism_15 1 1 1 1 1 1 1
Organism_16 1 1 1 1 1 1 1
Organism_17 1 1 1 1 1 1 1
Organism_18 1 1 1 1 1 1 1
Organism_19 1 1 1 1 1 1 1
Organism_20 1 1 1 1 1 1 1
Organism_21 0 0 0 0 0 0 1
Organism_22 1 1 1 1 1 1 1
Organism_23 1 1 1 1 1 1 1
Organism_24 1 1 1 1 1 0 1
the output I want is a table for each column like the next
a
Organism_1 1
Organism_2 1
Organism_3 1
Organism_4 1
Organism_5 1
Organism_6 1
Organism_7 1
Organism_8 1
Organism_9 1
Organism_10 0
Organism_11 1
Organism_12 1
Organism_13 1
Organism_14 1
Organism_15 1
Organism_16 1
Organism_17 1
Organism_18 1
Organism_19 1
Organism_20 1
Organism_21 0
Organism_22 1
Organism_23 1
Organism_24 1
I hope someone can help me, thanks
only
because the default delimiter is tab.
if you really want to set the delimiter:
cut -f 1 -d $'\t'
Tab is the default delimiter for
cut
so why not trycut -f1,2
thencut -f1,3
etc? What does that get you?Your expected output is not clear. Do you want 7 different files, one per each column?