I would like to write every line of a txt-file to a separate file and use the first column as the name of the new file. The new file should then contain everything else in the line, but column 1.
So when I have:
example_1 a b c d
example_2 e f g h
example_3 j k l m
I want 3 separated files that are named example_1.mop, example_2.mop and example_3.mop and contain everything after the first column. So example_1.mop should contain a b c d and so on.
I almost found a way with
awk '{printf "%s\n", $2>$1".mop"}' file
but this only puts the second column in the new file. How can I tell awk to use everything else but the first column?
Thanks a lot for your help!