split header row into one column

So, I have a massive file with thousands of columns

I want a list of the headers in one column in another file.

So I need to strip off the top line (can use head-1)

But how can I convert from this format:
A B C D E F G

to

A
B
C
D
E
F
G

Thanks in advance :slight_smile:

Use for loop

echo 'A B C D E F G' | tr ' ' '\n'

sorry to be dumb, but how do I pipe the output from my head -1 command into the echo command?

head -1 filename | tr -s ' ' '\n' > newfilename
head -1 myFile | tr ' ' '\n'

Amazing - thanks everyone