Script in MATLAB or DOS to rm 1st line of fil

Acer / Aspire 1410
July 20, 2010 at 20:51:12
Specs: Microsoft Windows 7 Home Premium, 1.2 GHz / 2974 MB

This is not another iteration of the same question.

I'd like to remove the first line of a text file but without a for loop rewriting it to another file because it's too slow when it comes to processing a 1GB text file.

Thanks :)

See More: Script in MATLAB or DOS to rm 1st line of fil

Report •

July 21, 2010 at 13:38:10
No way to do it with a Batch Script. In order to remove the line, the data must be rewritten to the drive taking up different sectors on the drive. You could write something that access the Drives RAW data and remove the data then update the File Allocation Table with the new start of file location. But you will probably need to do this with Assembly which I am no good at.

That being said why is your File 1GB in size? You should consider breaking the file up into smaller sub-files.

Report •

July 21, 2010 at 13:47:59
more +1 original.txt > newfile
move /y newfile original.txt
might work, depending. like ace said, almost no easy way to do an "in-place" surgery for such large files. debug and edlin
can handle smaller files. vbscript, as far as i know, won't allow
read+write access, only one or the other.

Report •

Related Solutions

Ask Question