May-11-2017, 09:34 PM
You're not really deleting anything. "skipping" a few lines just means you'll be reading from the infile, but not writing to the outfile for a few lines. So writing a tab character doesn't make sense (you should be reading, not writing).
Aside from that...
- you open a bunch of file handles, and only close some of them (you don't need to open either infile or outfile more than once... and
- I don't know why the function
- in omit(), you have omitline = "some string". You should call int() on it, as right now you're looping over how many characters they type, not whatever number they give (so it'll probably always be 1, unless they type at least 10).
Aside from that...
- you open a bunch of file handles, and only close some of them (you don't need to open either infile or outfile more than once... and
with
blocks are your friend)- I don't know why the function
lines()
exists... or why you call it. - in omit(), you have omitline = "some string". You should call int() on it, as right now you're looping over how many characters they type, not whatever number they give (so it'll probably always be 1, unless they type at least 10).