Mud-club
Chat & Social => The Bar - General Chat => Topic started by: Horness on December 20, 2005, 14:43:07
-
I am looking for either some nifty code, or a small app to automate the editing of a text file. (Anyone sh*t hot with batch files?)
The text file format does not need to be changed, however the first line, and last 2 lines need to be removed for it to work correctly with another application. The text file can vary in length, and filename as well.
I know it's only a 5 second job to strip them out and re-save, however the "operator" who will be doing this is about as technical as a bowl of salad, and still stares in awe as the arrow moves on screen when she moves the mouse.
Any help appreciated.
Horness.
-
In *nix, it's an easy one liner:
cat inputfile.txt | sed '1 d' | sed '$ d' | sed '$ d' > outputfile.txt