I need to create an output text file by deleting the first two lines of the input file.
I am currently using sed "1,2d" input.txt> output.txt
I need to do this for thousands of files, so I use python:
import os
for filename in somelist:
os.system('sed "1,2d" %s-in.txt > %s-out.txt'%(filename,filename))
but it is rather slow.
I need to save the original file, so I cannot install it in place.
Is there any way to do this faster? Using anything other than sed? Perhaps using some other scripting language than python? Should I write a short program in C or can a file-write on disk be a bottleneck?
source
share