I am trying to get the first row of a file.txt
(tab separated strings) and create a new file with one column which is made of the elements of the row I want to extract. I managed to get the first row of the file with
f = open("file.txt", "r")
row1 = f.readline()
I tried the ("new_file.txt", w)
after transposing with x.T
but it didn't work. After I get the file I should also split in in 10 smaller files.
This is an example of the input file:
rs123 rs15 rs1567 rs43 rs567 rs3564
1 2 3 4 5 6
7 8 9 10 11 12
and this is what I need:
rs123
rs15
rs1567
rs43
rs567
rs3564