I have a very large file with more than a million columns. I need to add a second, third, fourth, fifth and sixth column to the file, with the second column being a copy of the first, and the other columns containing the same value on each row. So for example, I have a file that looks like this:
id1 A A C T ..
id2 A G T C ..
id3 G A T C ..
id4 G G T T ..
.
.
And I need to change it to:
id1 id1 0 0 -9 -9 A A C T ..
id2 id2 0 0 -9 -9 A G T C ..
id3 id3 0 0 -9 -9 G A T C ..
id4 id4 0 0 -9 -9 G G T T ..
.
.
Any ideas on how to do this efficiently under Unix (since I need to repeat this a lot of times)?
If that’s not fast enough write a C++ program, it’s just a couple of lines.