16 October, 2008
Line Eater is a simple Windows command line application to remove lines from the start of any file. I use it in a batch file to process the deployment of a large web application.
LineEater.zip 4KB
Requires Windows and .NET Framework 3.5.
Extract the .exe file. Put it somewhere and it to the Windows path variable or put it in the folder you will run it from. I have it in a folder with a batch file I use to copy the web application then run LineEater and some other tools on the copy.
C:\LineEater input.txt output.txt 2
This is line 1
The second line
Hi, I'm line 3
Followed by line four
Hi, I'm line 3
Followed by line four
Here is how you could use it in a batch file to strip the first 3 lines from each JS file in a folder:
@echo off
FOR %%f IN (*.js) DO (
LineEater %%f %%f.temp 3
move %%f.temp %%f
)
Just paste it into an empty text file and give the file a .bat extension. I use similar code in a larger batch file as one step of several.
Download and use this for free. This work is licensed under a Creative Commons Attribution 3.0 Unported License which means you can use it for pretty much anything.
I offer no support, guarantees, or warrantee. Use at your own peril. All I can say is it works for me.
©2008 Jade Ohlhauser