I am trying to rename the column headers of a large file, and I want to know the most efficient way to do so. Files are in the range of 10M to 50M lines, with ~100 characters per line in 10 columns.
A similar question was asked to remove the first line, and the best answer involved "tail". Efficient in-place header removing for large files using sed?
My guess is:
bash-4.2$ seq -w 100000000 1 125000000 > bigfile.txt
bash-4.2$ tail -n +2 bigfile.txt > bigfile.tail && sed '1 s/^/This is my first line\n/' bigfile.tail > bigfile.new && mv -f bigfile.new bigfile.txt;
Is there a faster way?