Mud-club

Chat & Social => The Bar - General Chat => Topic started by: Horness on December 20, 2005, 14:43:07

Title: O/T - Automated text file editing - CALLING TECHIES!
Post 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.
Title: O/T - Automated text file editing - CALLING TECHIES!
Post by: xmob on December 20, 2005, 20:17:16
In *nix, it's an easy one liner:

Code: [Select]
cat inputfile.txt | sed '1 d' | sed '$ d' | sed '$ d' > outputfile.txt
SimplePortal 2.3.5 © 2008-2012, SimplePortal